I have tried 47 ways to create a macro that accepts a (selected)
revision, and skips to the next revision. None of them work.
Has anyone had any luck doing this?
Many thanks.
Tom Kreutz
P.S. I'm using Word 2003 on Windows 2000
Klaus Linke - 21 Feb 2005 23:08 GMT
Hi Tom,
Might be easier to display the old dialog for accepting/rejecting revisions?
Dialogs(wdDialogToolsAcceptRejectChanges).Show
Once you have it, you can use it to record the macros, too ;-)
Selection.NextRevision (True)
to go to the next revision, and
Selection.Range.Revisions.RejectAll
Selection.Range.Revisions.AcceptAll
to then accept/reject the selected revision(s).
Regards,
Klaus
> I have tried 47 ways to create a macro that accepts a (selected)
> revision, and skips to the next revision. None of them work.
[quoted text clipped - 6 lines]
>
> P.S. I'm using Word 2003 on Windows 2000
Helmut Weber - 22 Feb 2005 03:38 GMT
Hi Tom,
how about this one, only in principle:
Sub accept()
Dim l
Dim rtmp As Range
Set rtmp = Selection.Range
Selection.Collapse direction:=wdCollapseEnd
Selection.Bookmarks.Add Name:="bTmp", Range:=Selection.Range
' rtmp.Select ' for testing
l = rtmp.Revisions.Count
While l > 0
rtmp.Revisions(1).accept
rtmp.End = ActiveDocument.Bookmarks("bTmp").Range.End
l = rtmp.Revisions.Count
Wend
End Sub
I think the temporary bookmark is essential,
as the end of the range would otherwise move
into the following text with every deletion accepted.
You may delete the bookmark after finishing.
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/