3

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

I'd like a macro that can go through a Microsoft Word 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?

1
  • 1
    Did you tried anything ?
    – Ankit
    Feb 7, 2013 at 5:01

1 Answer 1

3

Just coded this (on Word 2010, though can't see anything that should prevent it working on older versions):

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

Which works, although obviously needs tidying up a bit :) You could create an Comment object (and specify things like Author, Initals...can't choose the colours though!)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.