Macro to edit comments....

Macro to edit comments....

Post by srgje » Sun, 11 Jul 2004 20:01:41


Is there an easy means for a macro/vba to edit the contents of
comments within a document, e.g., strip the user name and date from
comments throughout a document. Thank-you.
 
 
 

Macro to edit comments....

Post by Shauna Kel » Sun, 11 Jul 2004 23:08:55

Hi Steve

You can change the author and the initials for all comments in a document as
follows:

Sub ChangeAuthorName()

Dim oComment As Comment

For Each oComment In ActiveDocument.Comments
With oComment
.Author = "Bugs Bunny"
.Initial = "BB"
End With
Next oComment

End Sub

There is no way to change the date or time of a comment: it's a read-only
property.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.yqcomputer.com/

 
 
 

Macro to edit comments....

Post by srgje » Mon, 12 Jul 2004 09:25:52

Thanks!!!!!!!

Steve
 
 
 

Macro to edit comments....

Post by Sm9obiBPd2 » Thu, 23 Sep 2004 21:13:02

I would like to use VBA code to edit comments in a user form instead of the
usual comment window. I would like to run some VBA code to retreive the text
portion of the comment, then edit it in a user form, then copy the edited
comment back to the original comment.

In case you wonder why I want to do this it is because when I am working
with split windowpanes and open a comment to edit it, after closing the
comment edit window my split pane will also disappear.

I know how to add a comment via VBA code, but I haven't found a way to edit
an already existing comment.
Thanks for your help.
John