export word review comments in excel

Anonymous
2010-10-08T09:36:15+00:00

Hi , I have several Review comments in my word documents, I wan to export all these comments to excel sheet.

If it is possible by macros, please guide me with step by step process.

Regards,

RG

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

45 answers

Sort by: Newest
  1. Anonymous
    2015-06-25T05:10:37+00:00

    Graham Mayor, your codes have been a huge help!  

    In addition to exporting the comments into excel, I am also trying to do a few additional things:

    1. Create a column called "Revision Type" to capture the text from each author's revision. This can be "Insertion" or "Deletion".  For "Insertion", I'd like the captured text to be blue with underline; for "Deletion", I'd like the captured text to be red with strike through (mimicking what MS Word's track-changes function).  
    2. Create a column called "Page" to record which page each comment/revision is from. 

    These needs are a bit challenging to define.  Can anyone please help me?  Many thanks in advance.

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.6K Reputation points MVP Volunteer Moderator
    2015-02-04T04:48:57+00:00

    The following modification of my code in the thread at:

    http://answers.microsoft.com/en-us/profile/5846a56b-3e92-46d7-b5bf-4f65922e1f56?sort=lastreplydate&dir=desc&tab=qna&forum=&filter=All&page=1&tm=1374543937262

    will create a new document containing a table that displays the Page Number, the number of the Section in the document, the line number, the text upon which the comment is made, the text of the comment and the name of the person who made the comment.

    If the text upon which the comment was made, the table will include the contents of the cell that contain that text.  If the text is not in a table, it will display the text of the first paragraph to which the comment applies

     Dim source As Document, target As Document

     Dim tblTarget As Table

     Dim rowTarget As Row

     Dim i As Long, j As Long, p As Long, s As Long

     Dim strComment As String

     Dim strinitials As String

     Dim rngText As Range

     Set source = ActiveDocument

     Set target = Documents.Add

     Set tblTarget = target.Tables.Add(target.Range, 1, 6)

     With tblTarget

         .Cell(1, 1).Range.Text = "Page"

         .Cell(1, 2).Range.Text = "Section"

         .Cell(1, 3).Range.Text = "Line"

         .Cell(1, 4).Range.Text = "Text"

         .Cell(1, 5).Range.Text = "Comment"

         .Cell(1, 6).Range.Text = "Name"

     End With

     With source

         For i = 1 To .Comments.Count

             p = .Comments(i).Reference.Information(wdActiveEndPageNumber)

             s = .Comments(i).Reference.Information(wdActiveEndSectionNumber)

             l = .Comments(i).Reference.Information(wdFirstCharacterLineNumber)

             Set rngText = .Comments(i).Reference

            If rngText.Information(wdWithInTable) = True Then

                Set rngText = .Comments(i).Reference.Cells(1).Range

                rngText.End = rngText.End - 1

            Else

                Set rngText = .Comments(i).Reference.Paragraphs(1).Range

                rngText.End = rngText.End - 1

            End If

             strComment = .Comments(i).Range.Text

             strinitials = .Comments(i).Author

             Set rowTarget = tblTarget.Rows.Add

             With rowTarget

                 .Cells(1).Range.Text = p

                 .Cells(2).Range.Text = s

                 .Cells(3).Range.Text = l

                 .Cells(4).Range.Text = rngText.Text

                 .Cells(5).Range.Text = strComment

                 .Cells(6).Range.Text = strinitials

             End With

         Next i

     End With

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2015-02-03T13:52:10+00:00

    Hi Doug!  thank you very much for your quick response.  I am so sorry to trouble you but I have very limited knowledge on vba and excel/word macros.

    What I really want to pull into the excel is the actual words from the table columns to which the comments were tagged to.  Is it possible to do this?

    I am thinking that the Excel file will contain the same table as in the word but with the comments as a third column.

    Am very grateful for your help,

    Ailene

    Was this answer helpful?

    0 comments No comments
  4. Doug Robbins - MVP - Office Apps and Services 323.6K Reputation points MVP Volunteer Moderator
    2015-02-03T04:58:49+00:00

    To get the table row number, use

    ActiveDocument.Comments(i).Range.Information (wdEndOfRangeRowNumber)

    But best to check that the comment is in a table by using

     checking to see if ActiveDocument.Comments(i).Range.Information(wdWithInTable) = True

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2015-02-03T02:57:22+00:00

    Hi, trying this code to get comments from a word document to excel.  How do I change the codes so that I get the row items from a word table with the matching comments?

    thank you very much,

    Ailene

    Was this answer helpful?

    0 comments No comments