Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2018, 10:26 AM
Peterson Peterson is offline In anonymized document, how to locate specific comments via XML Windows 10 In anonymized document, how to locate specific comments via XML Office 2016
Competent Performer
In anonymized document, how to locate specific comments via XML
 
Join Date: Jan 2017
Posts: 143
Peterson is on a distinguished road
Default

Thanks, Paul. The comment name-change macro works fine in Word 2016.



For the second macro, I was getting runtime error 5941 here:

Code:
.Comments(j).Author = "External"
...so I modified a few lines (pasted below for posterity) and everything works great!

Thank you very much for your help!

Code:
Sub DemoB()
'Code from macropod:
'https://www.msofficeforums.com/word/40106-anonymized-document-how-locate-
'specific-comments-via.html#post132323


Application.ScreenUpdating = False
Dim DocSrc As Document, DocTgt As Document
Dim i As Long, j As Long
Set DocSrc = ActiveDocument
With Dialogs(wdDialogFileOpen)
  If .Display Then
    Set DocTgt = Documents.Open(FileName:=.Name, _
      AddToRecentFiles:=False, Visible:=True)
  End If
End With
If DocTgt Is Nothing Then Exit Sub

With DocTgt
    For Each Cmnt In ActiveDocument.Comments
      Cmnt.Author = "External"
    Next
End With

With DocSrc
  For i = 1 To .Comments.Count
    With DocTgt
      For j = i To .Comments.Count
        With .Comments(j)
          If .Scope.Text = DocSrc.Comments(i).Scope.Text Then
            If .Range.Text = DocSrc.Comments(i).Range.Text Then
              .Author = "Internal"
              Exit For
            End If
          End If
        End With
      Next
    End With
  Next
End With
'cleanup
Set DocTgt = Nothing: Set DocSrc = Nothing
Application.ScreenUpdating = True
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
In anonymized document, how to locate specific comments via XML Comments collapsed in document hander Word 2 10-09-2015 05:33 AM
Change name of document owner when writing comments Mark Laslett Word 2 08-25-2015 01:03 PM
In anonymized document, how to locate specific comments via XML Recreating a document with comments? mrlemmer11 Word VBA 3 06-29-2015 05:04 AM
Cannot Locate Archived Messages abraxis Outlook 0 06-10-2014 03:32 PM
Can't see comments on front page of Word document Josaster Word 0 10-15-2012 06:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft