Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Macro to accept revisions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tomkreutz@gmail.com - 21 Feb 2005 20:34 GMT
 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/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.