Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-06-2016, 09:13 PM
gmayor's Avatar
gmayor gmayor is offline Help with VBA to Conditionally Accept Changes Windows 10 Help with VBA to Conditionally Accept Changes Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
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
 

Tags
accept changes, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with VBA to Conditionally Accept Changes Conditionally playing a wave file blackjack Excel Programming 1 10-11-2014 06:25 AM
Insert a text conditionally deboer Word 1 05-04-2014 03:35 PM
Help with VBA to Conditionally Accept Changes changing font size conditionally newton.rogers Excel 1 03-18-2014 12:57 PM
Help with VBA to Conditionally Accept Changes How to conditionally format this? g4tv4life Excel 2 03-13-2014 10:58 AM
Help with VBA to Conditionally Accept Changes Macro to conditionally delete rows Steve_D Excel 2 08-24-2012 09:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:51 PM.


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