I have been using a macro by Rodney Atkins called "ReinsertComments" that was posted by someone in the comments section over at CyberText (see macro below): https://cybertext.wordpress.com/2013/04/10/word-removing-reviewer-names/. It reinserts all the comments in a Word document. I would like to find a way, if at all possible, to reinsert only one user's comments, but not all other users' comments.
- Is it possible to specify per author which comments will be reinserted?
- Could you run an If/Then statement to specify a user name for the comments to be reinserted? Perhaps something along the lines of
If myComment.Author = "Jane" Then
- If a version of that is possible, where should I insert the If/Then and End If portion in the macro below?
Thanks to all! :)
Sub CommentsReinsert()
Dim myComment As Comment
Dim myComText As String
Dim comStart
Dim comEnd
Dim i
On Error GoTo Done
Application.ScreenUpdating = False
If ActiveDocument.TrackRevisions = True Then
With ActiveDocument
.TrackRevisions = False
End With
End If
For i = ActiveDocument.Comments.Count To 1 Step -1
Set myComment = ActiveDocument.Comments(i)
myComText = myComment.Range.Text
comStart = myComment.Scope.Start
comEnd = myComment.Scope.End
myComment.Reference.Select
myComment.Delete
ActiveDocument.Range(comStart, comEnd).Select
ActiveDocument.Comments.Add _
Range:=Selection.Range, Text:=myComText
Next i
ActiveWindow.ActivePane.Close
Application.ScreenUpdating = True
Done:
End Sub