Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Changing the author of comments - any help appreciated

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Howdon - 03 Mar 2005 21:06 GMT
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

Signature

To contact me take a davidhowdon and add a @yahoo.co.uk to the end.

Cindy M  -WordMVP- - 26 Mar 2005 11:05 GMT
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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.