Tracking Comments in Word

R

rahul4real

Hi,
I need to track the comments made in the Word document. It should show
the line no. along with the comments made.

Can anyone please suggest a method to do this using macro or whatever
methods possible. :)

Thanks
 
P

Pesach Shelnitz

Hi,

Try this and see if it gives you what you need.

Sub TrackComments()
Dim myRange As Range
Dim report As String
Dim i As Integer

With ActiveDocument
For i = 1 To .Comments.Count
Set myRange = .Comments(i).Scope
report = report & "Page " & _
myRange.Information(wdActiveEndPageNumber) & " Line " & _
myRange.Information(wdFirstCharacterLineNumber) & _
": " & .Comments(i).Range.Text & vbCrLf
Next
If .Comments.Count <> 0 Then
MsgBox report
Else
MsgBox "No comments were found."
End If
End With
End Sub
 
G

Graham Mayor

See if

Sub ExtractComments()
Dim sDoc As Document
Dim tDoc As Document
Dim sLine As Integer
Dim sPage As Integer
Set sDoc = ActiveDocument
Set tDoc = Documents.Add
With sDoc
For i = 1 To .Comments.Count
.Comments(i).Reference.Select
sPage = Selection.Information(wdActiveEndPageNumber)
sLine = Selection.Information(wdFirstCharacterLineNumber)
If i = 1 Then
tDoc.Range.InsertAfter .Comments(i).Range.Text
Else
tDoc.Range.InsertAfter vbCr & .Comments(i).Range.Text
End If
tDoc.Range.InsertAfter " - Page " & sPage & " Line " & sLine
Next i
End With
tDoc.Activate
End Sub

works for you.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top