Word: Macros to switch from No Markup to All Markup views

Post date: Nov 29, 2020 3:7:49 AM

This following content is copied from https://cybertext.wordpress.com/2019/06/02/word-macros-to-switch-from-no-markup-to-all-markup-views/

I worked on a 350p technical report the past two weeks, and was forever switching between No Markup (Final) view and All Markup (Final: Show Markup [i.e. track changes]) view. Moving the mouse to do that got old pretty quick, even though I have that control on my Quick Access Toolbar. What I needed was a keyboard command or two to flip between views. Well, I couldn’t find one! I couldn’t even find the command in the list of all commands. That’s not to say one doesn’t exist—just that I couldn’t find it. Update 5 June 2019: Angela, one of this blog’s subscribers, had a solution that she shared with me. I’ll leave the other macros in this post, but if you want one that just does it all in one toggle command, skip the information below and scroll down to the end under ‘Angela’s solution’.

What to do? Well, one way to get a keyboard shortcut it to create a macro that does what you want to do, and then assign a keyboard shortcut to it. That’s what I ended up doing, except I had to create two macros—one for showing and one for hiding the track changes (I couldn’t figure out how to create a ‘toggle’ macro that used the same command to turn on and off, depending on the current state). And I assigned these keyboard shortcuts that had some logic for me: Ctrl+Shift+{ (i.e. open the bracket) to show the markup, and Ctrl+Shift+} (i.e. close the bracket) to hide the markup. But you can use whatever shortcut that works for you.

The two macros I wrote are below. Once you’ve added them to you VBA area, assign a keyboard shortcut to them from the Customize Ribbon options area.

This macro shows all markup:

Sub MarkupViewAll() ' ' Shows All Markup view for markup (i.e. shows track changes) ' Created by Rhonda Bracey, CyberText Consulting, 31 May 2019 ' ' With ActiveWindow.View .ShowRevisionsAndComments = True End With End Sub

This macro shows the final view:

Sub MarkupViewFinal() ' ' Shows Final view for markup (i.e. hides track changes) ' Created by Rhonda Bracey, CyberText Consulting, 31 May 2019 ' ' With ActiveWindow.View .ShowRevisionsAndComments = False .RevisionsView = wdRevisionsViewFinal End With End Sub

I’m sure somebody cleverer with macros than me could write something more elegant (such as using the one macro and keyboard shortcut to toggle the view depending on the current view—if you know how to do that, feel free to contribute in the comments.

Angela’s solution

NOTE: Some of this macro goes off the page—to get it all, copy this macro, don’t retype it.

Sub ToggleMarkupViewAllToFinal() ' ' Toggles from Markup view all to Markup view final ' ActiveWindow.View.ShowRevisionsAndComments = Not ActiveWindow.View.ShowRevisionsAndComments End Sub

Thanks Angela! (by the way, I assigned Alt+m as my keyboard shortcut for this—it works a treat!