OK, I ran your revised code with one comment, one insertion and one deletion.
I think that there were no fewer than seven message boxes that popped up in the process. Your user's might find that annoying.
The code error'd on this line: If (.Range.Text Like "*[ A-z0-9\,\.\?\(\)\;]*") _
You have not commented you code very well so I'm not sure what you are trying to do exactly but I did revise your final macro a bit and it runs without error:
Code:Public Sub iv_Grid_maker()
Dim oNewDoc As Document
Dim oTbl As Table
Dim NXTA As Boolean, NXTR As Boolean
Dim lngIndex As Long
Dim oRev As Revision
Dim lngRow As Long, i As Long, j As Long
Dim Rvtype As String, Rvpage As String, Rvsort As String, Rvauth As String, Rvtext As String
Set oDoc = ActiveDocument
lngRevisions = oDoc.Revisions.Count
If cmInc = False And revInc = False Then
MsgBox "No comments or revisions selected.", vbOKOnly + vbInformation
GoTo lbl_Exit
End If
MsgBox "Word may appear to freeze during this process!" & vbNewLine & vbNewLine & "Don't panic! Word has not crashed. Just wait for the process to finish." & vbNewLine & vbNewLine & "The more revisions and comments there are, the longer the process will take.", vbOKOnly, "DON'T PANIC!"
Application.ScreenUpdating = False
Set oNewDoc = Documents.Add
With oNewDoc
.PageSetup.Orientation = wdOrientLandscape
Select Case True
Case cmInc And revInc
.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "Comments and revisions extracted from: " & oDoc.Name
Case cmInc And Not revInc
.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "Comments extracted from: " & oDoc.Name
Case revInc And Not cmInc
.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "Revisions extracted from: " & oDoc.Name
End Select
With .Styles(wdStyleNormal)
.Font.Name = "Calibri"
.Font.Size = 9
.ParagraphFormat.LeftIndent = 0
.ParagraphFormat.SpaceAfter = 6
End With
With .Styles(wdStyleHeader)
.Font.Size = 8
.ParagraphFormat.SpaceAfter = 0
End With
Set oTbl = .Tables.Add(Selection.Range, lngComments + lngRevisions + 1, 7)
With oTbl
.Range.Style = wdStyleNormal
.AllowAutoFit = False
.PreferredWidthType = wdPreferredWidthPercent
.PreferredWidth = 100
.Columns.PreferredWidthType = wdPreferredWidthPercent
.Columns(1).PreferredWidth = 5
.Columns(2).PreferredWidth = 10
.Columns(3).PreferredWidth = 25
.Columns(4).PreferredWidth = 25
.Columns(5).PreferredWidth = 15
.Columns(6).PreferredWidth = 30
.Columns(7).PreferredWidth = 2
With .Rows(1)
.HeadingFormat = True
.Range.Font.Bold = True
.Cells(1).Range.Text = "Page"
.Cells(2).Range.Text = "Type"
.Cells(3).Range.Text = "Comment"
.Cells(4).Range.Text = "Relevant text"
.Cells(5).Range.Text = "Commenter"
.Cells(6).Range.Text = "Action/response"
.Cells(7).Range.Text = "Sort"
End With
End With
If cmInc = True Then
lngRow = 1
For lngIndex = 1 To lngComments
NXTA = False
If cmEx = True Then
For i = LBound(Cmt2exArr) To UBound(Cmt2exArr)
If .Comments(lngIndex).Author = Cmt2exArr(i) Then NXTA = True
Next
End If
If NXTA = False Then
lngRow = lngRow + 1
oTbl.Rows.Add
With oTbl.Rows(lngRow)
.Cells(1).Range.Text = oDoc.Comments(lngIndex).Scope.Information(wdActiveEndPageNumber)
.Cells(2).Range.Text = "Comment"
.Cells(3).Range.Text = oDoc.Comments(lngIndex).Range.Text
.Cells(4).Range.Text = oDoc.Comments(lngIndex).Scope
.Cells(5).Range.Text = oDoc.Comments(lngIndex).Author
.Cells(7).Range.Text = oDoc.Comments(lngIndex).Scope.Information(wdFirstCharacterLineNumber)
End With
End If
Next
End If
If revInc Then
If (cmInc = False) Or (comSkip = True) Then lngRow = 1
On Error GoTo NextRevb
For lngIndex = 1 To lngRevisions
Set oRev = oDoc.Revisions(lngIndex)
With oRev
NXTR = False
If revEx = True Then
For j = LBound(Rev2exArr) To UBound(Rev2exArr)
If .Author = Rev2exArr(j) Then NXTR = True
Next
End If
If NXTR = False Then
lngRow = lngRow + 1
If (.Range.Text Like "*[ A-z0-9\,\.\?\(\)\;]*") And (.Type = wdRevisionDelete) Then
Rvtype = "Delete"
Rvpage = .Range.Information(wdActiveEndPageNumber)
Rvauth = .Author
Rvsort = .Range.Information(wdFirstCharacterLineNumber)
Rvtext = """" & .Range.Text & """"
ElseIf (.Range.Text Like "*[ A-z0-9\,\.\?\(\)\;]*") And (.Type = wdRevisionInsert) Then
Rvtype = "Insert"
Rvpage = .Range.Information(wdActiveEndPageNumber)
Rvauth = .Author
Rvsort = .Range.Information(wdFirstCharacterLineNumber)
Rvtext = """" & .Range.Text & """"
Else
Rvtype = ""
Rvpage = ""
Rvauth = ""
Rvsort = ""
Rvtext = ""
End If
End If
End With
If NXTR = False Then
oTbl.Rows.Add
With oTbl.Rows(lngRow)
.Cells(1).Range.Text = Rvpage
.Cells(2).Range.Text = Rvtype
.Cells(4).Range.Text = Rvtext
.Cells(5).Range.Text = Rvauth
.Cells(7).Range.Text = Rvsort
If Rvtype = "Delete" Then
.Cells(2).Range.Font.Color = wdColorRed
.Cells(4).Range.Font.Color = wdColorRed
ElseIf Rvtype = "Insert" = True Then
.Cells(2).Range.Font.Color = wdColorBlue
.Cells(4).Range.Font.Color = wdColorBlue
End If
End With
End If
NextRevb:
Next
End If
End With
oDoc.Activate
crsRng.Select
ActiveWindow.ActivePane.VerticalPercentScrolled = scrllPs
Finalise:
oNewDoc.Activate
With oTbl.Borders ' Tracker.Borders
.InsideLineStyle = wdLineStyleSingle
.OutsideLineStyle = wdLineStyleSingle
End With
oTbl.Select
With Selection
.Sort ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
:=wdSortFieldNumeric, SortOrder:=wdSortOrderAscending, FieldNumber2:= _
"Column 7", SortFieldType2:=wdSortFieldNumeric, SortOrder2:= _
wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _
wdSortSeparateByCommas, SortColumn:=False, CaseSensitive:=False, _
LanguageID:=wdEnglishUK, SubFieldNumber:="Paragraphs", SubFieldNumber2:= _
"Paragraphs", SubFieldNumber3:="Paragraphs"
.Columns(7).Delete
End With
With oTbl
For lngIndex = .Rows.Count To 1 Step -1
If Len(.Rows(lngIndex).Range.Text) = 14 Then .Rows(lngIndex).Delete
Next lngIndex
End With
Application.ScreenUpdating = True
Application.ScreenRefresh
oNewDoc.Activate
MsgBox cmSummary & revSummary & "Finished creating tracker.", vbOKOnly + vbInformation, "Job summary"
lbl_Exit:
Set oNewDoc = Nothing: Set oTbl = Nothing: Set oRev = Nothing
End Sub
We each develop our own styles. I find it easier when my variables have meaningful names e.g., lngComments vs nCount.