Word Macro: Deleting All Comments

This Word VBA macro allows us to delete all comments in active document.

Macro Example

Sub DeleteAllComments()

  ActiveDocument.DeleteAllComments

End Sub

Description

We need only the following code:

  ActiveDocument.DeleteAllComments

The Application.ActiveDocument property returns an active Document object.

obj-Word-Application-ActiveDocument

The ActiveDocument property is a member of the Word.Global class, so we can omit the Application property.

obj-Word-ActiveDocument

The Document object has the DeleteAllComments method.
obj-Word-Document-DeleteAllComments
The Document.DeleteAllComments method allows us to delete all the comments in the document without looping.

Sub DeleteAllComments()

  ActiveDocument.DeleteAllComments

End Sub

Properties

http://www.relief.jp/itnote/archives/018238.php

Apply To

  • Word 2013
  • Word 2010
  • Word 2007