I would like to remove in an exported word document (.docx) all protected comments using VBA.
The comments are protected by some kind of fields they rely on (however I couldn't find a way to remove this protection with or without VBA). Those "fields" were generated when exporting from the application (Polarion ALM).
I was trying in the Word Macros the following to remove the protected comments:
Sub MakroRemoveComment()
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:=strPassword
End If
ActiveDocument.DeleteAllComments
End Sub
but I ended up with following error message:
The method 'DeleteAllComments' for the object 'comment' failed.
I guess this is due to the protection of the comment fields.
Screenshot: