PDA

View Full Version : Inserting comment bubbles?



amitrus
02-06-2013, 09:16 PM
Hi all,

I have a problem, and I want to know if a macro can solve it:

I'd like a macro that can go through an MSWord document, find every occurrence of a text string, and then highlight the string and create a comment bubble (the kind you get using "track changes") that contains a second text string (e.g., "This seems wrong.").

Can macros insert comment bubbles in that sort of way?

Thanks for your help!

Amitrus

PS: I'm a bit new to this, so forgive me if any of my questions seem silly.

macropod
02-06-2013, 11:22 PM
Cross-posted at: http://www.msofficeforums.com/word-vba/15885-inserting-comment-bubbles-msword.html
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

amitrus
02-07-2013, 07:52 AM
Apologies for the cross-posting.

I managed to get a solution to the problem. The following works:


Sub CommentBubble()
'
' CommentBubble Macro
'
'
Dim range As range
Set range = ActiveDocument.Content

Do While range.Find.Execute("aaa") = True
ActiveDocument.Comments.Add range, "my comment"
Loop
End Sub