View Single Post
 
Old 09-06-2016, 09:13 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Without a document to evaluate, and the rest of the code for the process, it is difficult to judge, but based upon what you have presented, I would suggest something like:

Code:
Public Sub Test_Document_AcceptAll(newRevision As Revision, _
                                   newbool As Boolean)
    If newbool = True Then
        ActiveDocument.Revisions.AcceptAll
    Else
        On Error GoTo RevErr
        Select Case True
            Case Left(newRevision.FormatDescription, 15) = "Formatted Table": newRevision.Accept
            Case Left(newRevision.FormatDescription, 10) = "Formatted:": newRevision.Accept
            Case Left(newRevision.FormatDescription, 11) = "Field Code:": newRevision.Accept
        End Select
    End If
lbl_Exit:
    Exit Sub
RevErr:
    If Err.Number <> 5852 Then
        Err.Clear
        GoTo lbl_Exit
    Else
        Err.Clear
        Resume
    End If
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote