Commenting Bubbles in Word 2007...

A

Andrew

I am using a simple VBA command (in combination with a custom ribbon) to
insert Comments.

Here's the code:
Selection.Comments.Add Range:=Selection.Range, Text:=MyText

I'm wondering:
1) If there is any way to get rid of the word "Comment" that automatically
appears
and
2) If I can automatically put formatted text into the Comment. That is, the
MyText variable above is plain text, but I'd like to include automatically
formatted bullets and hyperlinks. I tried to do it via macro but ended up
formatting the text of the actual document, not the text going into the
bubble.

Many thanks in advance for any help.
 
J

Jay Freedman

Answers in line...
I am using a simple VBA command (in combination with a custom ribbon)
to insert Comments.

Here's the code:
Selection.Comments.Add Range:=Selection.Range, Text:=MyText

I'm wondering:
1) If there is any way to get rid of the word "Comment" that
automatically appears

No. If that's necessary then you need some feature other than Comments.
and
2) If I can automatically put formatted text into the Comment. That
is, the MyText variable above is plain text, but I'd like to include
automatically formatted bullets and hyperlinks. I tried to do it via
macro but ended up formatting the text of the actual document, not
the text going into the bubble.

Many thanks in advance for any help.

The Comments.Add method returns a reference to the Comment object it
creates, which you can assign to a Comment variable. [Note that in order to
use the "function-like" syntax, you'll have to include parentheses around
the parameters.] Then the .Range property of the Comment variable refers to
the text of the comment bubble, and you can format that:

Sub demo()
Dim cmnt As Comment
Dim MyText As String
MyText = "Format as bold and italic"

Set cmnt = Selection.Comments.Add( _
Range:=Selection.Range, Text:=MyText)
With cmnt
.Range.Words(3).Bold = True
.Range.Words(5).Italic = True
End With
End Sub

--
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