Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2018, 04:57 PM
Peterson Peterson is offline Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Windows 10 Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Office 2016
Advanced Beginner
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu
 
Join Date: Jan 2017
Posts: 41
Peterson is on a distinguished road
Default Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu

I periodically see documents, all with track changes turned on, that have styles applied to the final paragraph mark, shown as revisions. When I click Review > Accept > Accept All Changes, the formatting change associated with the last paragraph in the document is accepted; however, when I run a macro to achieve the same thing, the revision remains. (All other revisions in the document are accepted.)

Code:
Sub WhyIsntThisDoingTheSameThingAsViaTheReviewMenu()
      ActiveDocument.AcceptAllRevisions
  End Sub
I tested three files, all based on different templates (one of which is based on a "pure," default Word template). Two of the three files (attached) failed to have these last-paragraph revisions cleared when running the macro. Why does the macro not work on the last paragraph mark, or, put another way, how can I force it to work on that final mark?




Thanks
Attached Files
File Type: docx Test Doc.docx (36.6 KB, 2 views)
File Type: docx Test Doc 4 - based on default template.docx (12.7 KB, 2 views)
Reply With Quote
  #2  
Old 03-25-2020, 07:03 PM
Peterson Peterson is offline Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Windows 10 Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Office 2019
Advanced Beginner
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu
 
Join Date: Jan 2017
Posts: 41
Peterson is on a distinguished road
Default

Bringing this back from the dead - hoping someone can shed some light on this, as I never figured this out and would love to be able to loop through dozens of files at a time and accept all revisions, regardless of whether there are revisions in the last paragraph. Thanks!
Reply With Quote
  #3  
Old 03-25-2020, 09:19 PM
Guessed's Avatar
Guessed Guessed is offline Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Windows 10 Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,567
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

Just in time for the zombie apocalypse...

Since the built-in command works, you could use that in your code instead

Code:
Application.CommandBars.ExecuteMso ("AcceptAllChangesInDocAndStopTracking")
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 03-25-2020, 10:03 PM
Peterson Peterson is offline Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Windows 10 Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Office 2019
Advanced Beginner
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu
 
Join Date: Jan 2017
Posts: 41
Peterson is on a distinguished road
Default

Ha, yes, the impending zombie apocalypse!

Thank you, Andrew, for the solution!

Incidentally, I also need to leave track changes turned on in these docs I'm looping through, so, in case someone else finds this post and has a similar need, I ended up going with this:
Code:
Application.CommandBars.ExecuteMso ("ReviewAcceptAllChangesInDocument")
...having just learned that you can find out the built-in command name via customizing the Quick Access Toolbar and hovering over the item in the list (after discovering that "AcceptAllChangesInDoc" doesn't work; so much for consistency...).
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Having Revision Bars Persist after Accepting Changes gocuse Word 3 08-20-2017 10:47 PM
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu WORD not accepting .png file Fr. Jonathan Drawing and Graphics 1 07-26-2017 08:24 PM
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Track Changes Automatically Accepting Changes after Closing and Re-Opening Document cnethercott Word 1 01-16-2017 03:21 AM
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Accepting changes with TC deletes undeleted narrative jklein Word 4 10-02-2016 06:09 PM
Accepting track changes via macro skips last paragraph mark, but not when accepting via Review menu Leaving change indicators after accepting changes jpbledsoe Word 2 08-14-2006 07:59 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 10:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft