Hi all,
RE: Word 2003 – VBA – To delete all comments within an area of text
1. Is there a user operation available to delete all comments within just an area of text I select of a document?
2. Well I couldn’t find a user operation that does the above, so I tried to write a VBA routine that deletes all comments that I select – see below. However it insists on deleting all the comments in the document up to and including all the comments within my selection. Can anybody make that work?
Sub Comments_DeleteAllSelected() Dim Cmnt As Comment For Each Cmnt In Selection.Comments Cmnt.Delete Next Cmnt End Sub
3. I macro-recorded myself deleting a single comment that I selected (i.e., I selected the comment itself, not an area of text in Word), and it recorded the statement, WordBasic.RejectChangesSelected, but when I tried to run that in my own code, I got the error message: “this command is not available”.
TIA
avi