Export Word Comment Numbers and Text to a New Document
Question details
Export Word comments to a new document with comment identifiers, text, authors, and page numbers.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A user wants a text-based table of comments instead of the graphical Print List of Markup output.
- Observed behavior
- The desired output is an editable table in a new document, with a comment identifier in place of the commented text.
Open the document containing the comments in a desktop version of Word that supports VBA. Check that the document has comments and that your Word security settings allow you to run a macro you create.
Create a Word VBA macro to export comments as a table
Use this macro to create an editable four-column table with page numbers, generated comment identifiers, comment text, and authors.
The identifier combines the comment author's initials with the comment's position in Word's Comments collection, such as [M2]. It may not match the identifier displayed in every version of Word, especially for threaded comments or comments with missing initials.
In Word, open the document with comments, then open the VBA editor from Developer > Visual Basic. If Developer is not visible, enable it in Word's ribbon settings.
In the VBA editor, choose Insert > Module and paste the following code: Sub ExportCommentTable() Dim sourceDoc As Document Dim outputDoc As Document Dim commentTable As Table Dim commentItem As Comment Dim n As Long Set sourceDoc = ActiveDocument If sourceDoc.Comments.Count = 0 Then MsgBox "This document has no comments." Exit Sub End If Set outputDoc = Documents.Add Set commentTable = outputDoc.Tables.Add(outputDoc.Range(0, 0), sourceDoc.Comments.Count + 1, 4) commentTable.Cell(1, 1).Range.Text = "Page" commentTable.Cell(1, 2).Range.Text = "Comment ID" commentTable.Cell(1, 3).Range.Text = "Comment text" commentTable.Cell(1, 4).Range.Text = "Author" For n = 1 To sourceDoc.Comments.Count Set commentItem = sourceDoc.Comments(n) commentTable.Cell(n + 1, 1).Range.Text = CStr(commentItem.Scope.Information(wdActiveEndPageNumber)) commentTable.Cell(n + 1, 2).Range.Text = "[" & commentItem.Initial & CStr(commentItem.Index) & "]" commentTable.Cell(n + 1, 3).Range.Text = commentItem.Range.Text commentTable.Cell(n + 1, 4).Range.Text = commentItem.Author Next n End Sub
Return to the source document, select Developer > Macros, choose ExportCommentTable, and click Run. In the new document, review the table and use File > Save As to save it.

Review and edit Word documents with WPS Writer
WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Word documents. Its format compatibility makes it easy to move existing files into WPS Writer, though it does not fix or replace the Word VBA macro above.

Frequently Asked Questions
Can I change my existing export macro instead of creating a new one?
Yes. In Developer > Visual Basic, find the line that writes the comment's Scope to the second table column. Replace its value with the comment's Initial and Index formatted inside brackets, while keeping your existing table and row references.
Why might the exported identifier differ from the one shown in Word?
The macro generates an identifier from the author's initials and the comment's position in the Comments collection. Word's displayed identifiers and threaded-comment behavior can vary by version, so check the output against your document.
What happens if the document has no comments?
The macro checks the Comments collection before creating a table. If it is empty, Word displays a message and stops the export.
Can I edit the exported comments?
Yes. The macro creates a table in a new Word document. Click any cell to edit its text, then use File > Save As to save the result.




