Re: Track Changes VBA Granular information needed

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks Jay,

I made a seperate report, it is much easier than having to mix the two, plus
for metrics purposes, I added the count method in both reports to show me how
many track changes and comments are within the document.

Thanks again for all your help!


Paul





"Jay Freedman" wrote:

Krumrei wrote:
One last question.

I want to pull comments in the program too.

I added this.


Dim cmt = Comments


ElseIf ocmt.Range.Text = "0" Then
.Cells(3).Range.Text = "Comments"


Was wondering what Range, comments are under, or wd Properties?


As far as VBA is concerned, comments are completely separate from tracked
changes. Just as the tracked changes are in the ActiveDocument.Revisions
collection, the comments are in the ActiveDocument.Comments collection, and
they have nothing to do with each other.

You would need a separate part of your macro devoted to handling comments,
with a separate loop

Dim oCmt As Comment

For Each oCmt In ActiveDocument.Comments
' extract the properties of oCmt here, like this...
.Cells(2).Range.Text = oCmt.Author
.Cells(3).Range.Text = oCmt.Range.Text
Next

This loop cannot be intermixed with the loop that handles the Revisions
collection -- they must be separate loops. If you want the extracted table
to put the comments in between the tracked changes in the same order they
occur in the original document, you'll have to do that separately by keeping
track of the .Range.Start and .Range.End values (which are, respectively,
the number of characters from the beginning of the document to the start and
end of the Range) and inserting or moving table rows to match.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.



.



Relevant Pages

  • Re: Track Changes VBA Granular information needed
    ... Dim cmt = Comments ... You would need a separate part of your macro devoted to handling comments, ... with a separate loop ... For Each oCmt In ActiveDocument.Comments ...
    (microsoft.public.word.vba.beginners)
  • Re: Sending a "Final" Document that has tracked changes
    ... If you don't want the recipient to see your tracked changes, ... to save a separate copy, where you've accepted or rejected all ... How does Track Changes in Microsoft Word work? ... When the user opens the attachment, ...
    (microsoft.public.word.docmanagement)