Export Comments and Tracked Changes

Is there a way to export comments and changes from a document that has tracked changes?  (I know I can print just the comments, but I actually need them in table format).

Use a macro containing the following code:

Dim DocSource As Document, DocTarget As Document
Dim tbl As Table
Dim arev As Revision
Dim acomment As Comment
Dim i As Long
Dim strType As String
Set DocSource = ActiveDocument
Set DocTarget = Documents.Add
Set tbl = DocTarget.Tables.Add(Selection.range, 2, 3)
With tbl
    .Cell(1, 1).range.text = "Author"
    .Cell(1, 2).range.text = "Type"
    .Cell(1, 3).range.text = "Text"
End With
i = 2
With DocSource
    For Each arev In .Revisions
        tbl.Cell(i, 1).range.text = arev.Author
        Select Case arev.Type
            Case 1
                strType = "Insertion"
            Case 2
                strType = "Deletion"
            End Select
        tbl.Cell(i, 2).range.text = strType
        tbl.Cell(i, 3).range.text = arev.range.text
        tbl.Rows.Add
        i = i + 1
    Next arev
    For Each acomment In .Comments
        tbl.Cell(i, 1).range.text = acomment.Author
        tbl.Cell(i, 2).range.text = "Comment"
        tbl.Cell(i, 3).range.text = acomment.range.text
        tbl.Rows.Add
        i = i + 1
    Next acomment
End With
DocTarget.Activate

If there are other types of revisions in which you are interested, expand on the Select Case -  End Select construction by including the required entries from the wdRevisionType Enumeration:

WdRevisionType
Enumeration
Specifies the type of a change that is marked with a revision mark.

Name Value Description
wdNoRevision 0 No revision.
wdRevisionConflict 7 Revision marked as a conflict.
wdRevisionDelete 2 Deletion.
wdRevisionDisplayField 5 Field display changed.
wdRevisionInsert 1 Insertion.
wdRevisionParagraphNumber 4 Paragraph number changed.
wdRevisionParagraphProperty 10 Paragraph property changed.
wdRevisionProperty 3 Property changed.
wdRevisionReconcile 6 Revision marked as reconciled conflict.
wdRevisionReplace 9 Replaced.
wdRevisionSectionProperty 12 Section property changed.
wdRevisionStyle 8 Style changed.
wdRevisionStyleDefinition 13 Style definition changed.
wdRevisionTableProperty 11 Table property changed.
wdRevisionCellDeletion 17 Table cell deleted.
wdRevisionCellInsertion 16 Table cell inserted.
wdRevisionCellMerge 18 Table cells merged.
wdRevisionMovedFrom 14 Content moved from.
wdRevisionMovedTo 15 Content moved to.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks, this worked for me. I copied the macro you provided and then saved it in the macros in my document, gave it a name and then ran it. I was able to save it into excel & word.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 11, 2024 Views 3,500 Applies to: