View Single Post
 
Old 11-07-2023, 05:50 AM
DuchessNora DuchessNora is offline Windows 11 Office 2021
Novice
 
Join Date: Oct 2023
Posts: 6
DuchessNora is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
I think your logic is flawed. Having no replies doesn't mean the comment is a child-level comment. Instead you should be looking for presence of an Ancestor - top level comments don't have an ancestor. Then you can loop through any replies if they exist. Here is a snippet of code I'm currently using...
Code:
      For Each aCmt In wdDoc.Comments
        If aCmt.Ancestor Is Nothing Then        'a top level comment
           'do something
          If aCmt.Replies.Count > 0 Then
            For i = 1 To aCmt.Replies.Count
              Set aReply = aCmt.Replies(i)
              'do something with the replies
            Next i
          End If
        End If
      Next aCmt
Yes your right, I only just noticed when I used the other code it classed parents comments as not parents because they did not have any replies, I'll try changing it
Reply With Quote