Microsoft Word VBA script to accept all deletions?

I work with a lot of changes in Word 2010 (several authors with track changes). I would like to create a way to accept all deletes in a document without accepting the insert. I did some research and found an example of a VBA script that claimed to do this, but it just gave me an error message. That was a couple of weeks ago, and I cannot find the script or remember the error message.

Does anyone know how to do this? Thanks in advance.

DECISION:

Found the code I used, and for some reason, it works now.

Sub AcceptDeletion() Dim oChange As Revision For Each oChange In ActiveDocument.Revisions With oChange If .Type = wdRevisionDelete Then .Accept End If End With Next oChange End Sub 
+6
vba ms-word
source share
1 answer

You can be more careful if:

  With oChange
    If .Type = wdRevisionDelete Then
      .Accept
    End if
 End with 

you should have said:

  If oChange.Type = wdRevisionDelete Then oChange.Accept 
+1
source share

All Articles