Export (0) Print
Expand All

How to: Programmatically Remove All Comments from Documents

Use the DeleteAllComments method to remove all comments from a Microsoft Office Word document.

Applies to: The information in this topic applies to document-level projects and application-level projects for Word 2013 and Word 2010. For more information, see Features Available by Office Application and Project Type.

To remove all comments from a document that is part of a document-level customization

  • Call the DeleteAllComments method of the ThisDocument class in your project. To use this code example, run it from the ThisDocument class.

    this.DeleteAllComments();
    

To remove all comments from a document by using an application-level add-in

  • Call the DeleteAllComments method of the Microsoft.Office.Interop.Word.Document from which you want to remove comments.

    The following code example removes all comments from the active document. To use this code example, run it from the ThisAddIn class in your project.

    this.Application.ActiveDocument.DeleteAllComments();
    
Show:
© 2014 Microsoft