Macro to accept revisions

T

tomkreutz

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
 
K

Klaus Linke

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
 
H

Helmut Weber

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top