VBA Comment question

S

Susan

Dear Friends,

I need some help on this:

1) How can I change, via vba, the initials property of the author of the
current doc. I am making different types of comments and want them under
different initials. Going to options and changing manually is very tedious.

2) When viewing comments the text the comment is referring to is highlighted
by the comment color. How can I get the highlighted text into a variable?

Thank you

Susan
 
D

Doug Robbins - Word MVP

To change the Author and initials of all of the comments, use

Dim acomment As Comment
With ActiveDocument
For Each acomment In .Comments
acomment.Author "Joe Smith"
acomment.Initial = "JS"
Next acomment
End With

The following will change it for the selected comment and also change the
colour of the highlight

With Selection
If .Comments.Count = 1 Then
With .Comments(1)
.Author "Joe Smith"
.Initial = "JS"
.Reference.HighlightColorIndex = wdBrightGreen
End With
End If
End With




--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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