How to: Programmatically remove all comments from documents
Applies to: Visual Studio Visual Studio for Mac Visual Studio Code
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 VSTO Add-in projects for Word. 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
ThisDocumentclass in your project. To use this code example, run it from the
To remove all comments from a document by using a VSTO Add-in
Call the DeleteAllComments method of the 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
ThisAddInclass in your project.
Submit and view feedback for