Changing the author of comments - any help appreciated

D

David Howdon

What I wanted to create was a macro that went through each comment in
the document and presented it to the user in a dialogue box. If the
user clicked yes the name and initials of the comment should be changed
to some entered by the user at an earlier stage. Basically to be used
when one person has typed two peoples comments into a document.

SO I wrote the VBA code

Sub DeltaComment()
Dim oCmt As Comment
Dim newinit As String
Dim newname As String
newinit = InputBox("Enter Initials for updated comments", "Enter
Initials")
newname = InputBox("Enter Name for updated comments", "Enter Name")
For Each oCmt In ActiveDocument.Comments
If MsgBox(oCmt.Range, vbYesNo) = vbYes Then
oCmt.Initial = newinit
oCmt.Author = newname
End If
Next oCmt
End Sub

which I thought would work. However what that if I clicked yes it
changed the details of every comment.

I've probably made some really dumb mistake but cannot spot it. Any
help appreciated.

Thanks
 
C

Cindy M -WordMVP-

Hi David,
What I wanted to create was a macro that went through each comment in
the document and presented it to the user in a dialogue box. If the
user clicked yes the name and initials of the comment should be changed
to some entered by the user at an earlier stage.
You don't say which version of word you're trying to manipulate? I tested
this in Word 2003 and it worked just fine...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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