View Single Post
 
Old 10-24-2023, 02:53 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote