Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-12-2018, 01:06 PM
alzasp alzasp is offline Exporting Tracked Changes and Comments to Excel Windows 10 Exporting Tracked Changes and Comments to Excel Office 2016
Novice
Exporting Tracked Changes and Comments to Excel
 
Join Date: Sep 2018
Posts: 2
alzasp is on a distinguished road
Default Exporting Tracked Changes and Comments to Excel


Is there a macro I can use that exports the tracked changes, inserts and deletes, to excel? I have a macro (below) that exports the comments but it does not extract the tracked changes.

Code:
Sub CopyCommentsToExcel()
 'Create in Word vba
 Dim xlApp As Object
 Dim xlWB As Object
 Dim i As Integer
     On Error Resume Next
     Set xlApp = GetObject(, "Excel.Application")
     If Err Then
         Set xlApp = CreateObject("Excel.Application")
     End If
     On Error GoTo 0
     xlApp.Visible = True
     Set xlWB = xlApp.Workbooks.Add        ' create a new workbook
     With xlWB.Worksheets(1)
     ' Create Heading
        HeadingRow = 1
        .Cells(HeadingRow, 1).Formula = "ITEM NO."
        .Cells(HeadingRow, 2).Formula = "PAGE"
        .Cells(HeadingRow, 3).Formula = "REVIEWER"
        .Cells(HeadingRow, 4).Formula = "COMMENT"
        .Cells(HeadingRow, 5).Formula = "DATE"
        
         For i = 1 To ActiveDocument.Comments.Count
             .Cells(i + HeadingRow, 1).Formula = ActiveDocument.Comments(i).Index
             .Cells(i + HeadingRow, 2).Formula = ActiveDocument.Comments(i).Reference.Information(wdActiveEndAdjustedPageNumber)
             .Cells(i + HeadingRow, 3).Formula = ActiveDocument.Comments(i).Author
             .Cells(i + HeadingRow, 4).Formula = ActiveDocument.Comments(i).Range
             .Cells(i + HeadingRow, 5).Formula = Format(ActiveDocument.Comments(i).Date, "dd/MM/yyyy")
             .Cells(i + HeadingRow, 6).Formula = ActiveDocument.Comments(i).Range.ListFormat.ListString
         Next i
     End With
     Set xlWB = Nothing
     Set xlApp = Nothing
 End Sub

Last edited by macropod; 09-12-2018 at 02:27 PM. Reason: Added code tags & formatting
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert specific author's name in comments and tracked changes to another name rmk911 Word VBA 2 12-09-2021 09:14 PM
Tracked changes and comments disappeared with All Markup selected sleake Word 4 06-18-2018 05:12 AM
Exporting Tracked Changes and Comments to Excel Word for Mac 2011 - Lost all tracked changes and all comments Clint57 Word 1 08-24-2017 06:56 PM
Merging certain Tracked Changes and Comments The_Chefkoch Word 0 02-01-2017 07:22 AM
Exporting Tracked Changes and Comments to Excel Restrict editing: allowing forms, tracked changes AND comments andylaw31 Word 1 08-14-2015 03:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft