![]() |
#6
|
||||
|
||||
![]()
As I don't have a sample document to test on, I can't guarantee this would work but conceptually, this code will find graphics from the current selection forward and if the found graphic is marked as a tracked revision it rejects the change and searches for the next graphic.
Code:
Sub Huh() Dim aRng As Range Set aRng = Selection.Range aRng.End = ActiveDocument.Range.End With aRng.Find .ClearFormatting .Replacement.ClearFormatting .Text = "^g" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False Do While .Execute = True If aRng.Revisions.Count > 0 Then aRng.Revisions.RejectAll End If aRng.Collapse Direction:=wdCollapseEnd aRng.End = ActiveDocument.Range.End Loop End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
loop, macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Marcia | Excel | 4 | 08-11-2021 02:36 PM |
![]() |
mgroessl | Excel Programming | 5 | 08-06-2019 03:39 PM |
![]() |
crussell | Excel | 8 | 02-23-2016 07:38 AM |
![]() |
RBLampert | Word VBA | 13 | 10-23-2012 04:45 PM |
Paragraph ending in following page | tadlomc | Word | 1 | 01-18-2012 05:31 AM |