VBA Comment question

  • Follow


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

-- 
Change dead to live and you got my email address.
0
Reply Utf 1/10/2010 9:13:22 AM

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

"Susan" <scult@windowsdead.com> wrote in message 
news:4393D785-CECF-477B-9B60-2357CE2481C2@microsoft.com...
> 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
>
> -- 
> Change dead to live and you got my email address. 

0
Reply Doug 1/10/2010 9:26:51 AM


1 Replies
636 Views

(page loaded in 0.068 seconds)

4/12/2014 8:18:20 AM


Reply: