I have a simple Word macro to add a new comment on selected text:
Dim cmtMyComment As Comment
Set cmtMyComment = Comments.Add(Selection.range, "abc")
Debug.Print cmtMyComment.Index & ". " & Selection.range.Start & " - " & Selection.range.End
Debug.Print cmtMyComment.range.Start & " - " & cmtMyComment.range.End
and Word Document with a lot of comments on one page:
After I select some text at bottom of the page and run this macro, it works well. My comment is added as the last with comment text "abc" and comment index 38.
Debug output:
38. 1099 - 1107
1265 - 1268
When I right click on text-range of last comment and choose "Edit comment" (=Upravit komentar) it shows window to edit the comment.
After closing the Edit window I'm trying to select new text at the bottom and run my macro. The new comment is added at the selected position, but with no text - it's just a empty comment. Text of the comment is appended to the first comment of the page. So now each new comment is empty and text is appended to beginning of the first comment (comment index is now 1).
Debug output:
1. 1003 - 1011
1 - 17
I have MS Word 2016. Until I add comments without editing one in Edit window my macro works well.
Is there a workaround to add comments after editing one in the Edit window?