Getting the associated text referred to by a comment

K

Ken Valenti

I know how to get a list of comments in a document, but don't know how to
return the selected text that the comment refers to.

This macro will return a list the text of the comment itself, but I need to
know the text in the document that it is referring to.

Sub TestComments()
Dim comm As Comment
For Each comm In ActiveDocument.Comments
Debug.Print comm.Range.Text
Next
End Sub

Thanks in advance for any advice,
 
J

Jay Freedman

I know how to get a list of comments in a document, but don't know how to
return the selected text that the comment refers to.

This macro will return a list the text of the comment itself, but I need to
know the text in the document that it is referring to.

Sub TestComments()
Dim comm As Comment
For Each comm In ActiveDocument.Comments
Debug.Print comm.Range.Text
Next
End Sub

Thanks in advance for any advice,

Substitute (or add)

Debug.Print comm.Scope.Text
 
K

Ken Valenti

Perfect - thank you!

Jay Freedman said:
Substitute (or add)

Debug.Print comm.Scope.Text


--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
 

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