Extract Word Comments into a New Document with VBA
Question details
Extract comments from a Word document into a new document using a VBA macro, then transfer the comments to Excel if needed.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A user wants to run a macro from Word's Macros dialog to collect review comments for data management.
- Observed behavior
- The macro may not run when selected in the Macros dialog.
Open the Word document containing the comments and confirm that it has at least one review comment. If you store the macro in the document, save it as a macro-enabled Word document (.docm) and enable macros only if you trust the file.
Create a public comment-extraction macro in a standard module
Use this method to create a runnable macro that copies comment authors and text into a new Word document.
In Word, open Developer > Visual Basic. In the VBA editor, select the document or template where you want to store the macro, then choose Insert > Module.
Paste the following code into the standard module: Public Sub ExtractCommentsToNewDocument() Dim sourceDoc As Document Dim outputDoc As Document Dim c As Comment Set sourceDoc = ActiveDocument If sourceDoc.Comments.Count = 0 Then MsgBox "This document has no comments." Exit Sub End If Set outputDoc = Documents.Add For Each c In sourceDoc.Comments outputDoc.Content.InsertAfter "Author: " & c.Author & vbCr & _ "Comment: " & c.Range.Text & vbCr & vbCr Next c End Sub
Return to the document containing the comments. Choose Developer > Macros, select ExtractCommentsToNewDocument, and click Run. The macro creates a new document containing each comment's author and text.
Use File > Save As to save the new Word document. To manage the results in Excel, copy the comment details and paste them into worksheet cells, arranging authors and comments into columns as needed.

Debug an existing Word comment-extraction macro
Use Word's VBA debugger when an existing macro appears in the Macros dialog but stops or produces an error.
Review Documents and Manage Comment Data with WPS Office
WPS Office is a free, lightweight alternative for working with documents and spreadsheets in a familiar interface. Open Microsoft Office files as you move your work to WPS; diagnosing or running the Word VBA macro itself still requires Microsoft Word.

Frequently Asked Questions
Why doesn't my macro appear in Word's Macros dialog?
In Developer > Visual Basic, check that the procedure is public, has no required arguments, and is stored in a standard module. Use Insert > Module to create one if necessary.
What should I do when the macro stops with an error?
Click Debug in the error dialog and inspect the highlighted line in the VBA editor. You can also use Debug > Step Into to follow execution one line at a time.
Will the example macro export comments directly to Excel?
No. It creates a new Word document containing comment authors and text. Copy the results from that document and paste them into Excel cells to organize them.
How do I keep the macro in my Word document?
Use File > Save As and choose a macro-enabled Word document (.docm). Enable macros when prompted only if you trust the file.




