expedienceblog

Record a Word Macro

Many of the operations you can perform in Microsoft Word can be recorded as custom macros.  In this post we will look at how to use the 'Macro Recorder' feature.  

I frequently use bookmarks in my documents but turning the bookmark markers on and off requires going through a number of steps.  I need to go into File Options, Open the ‘Advanced’ screen and scroll around until I can locate the ‘Show Bookmarks’ check box.  

So, in this ‘Record Macro’ example I am actually going to record two macros: one to show the bookmarks and one to hide them.   

First, let’s locate the Macro Recorder:  
 
You can find macros on the ‘View Tab’ of the Word Ribbon (2007-2013):
 
Macros button appears on 'View Tab' of Word Ribbon
 

 

From the ‘Macros’ drop-down you can view a list of all of the macros that are currently available to you.

This is also where you can ‘Record’ a macro of your own.  
You can also find Macro functions on the ‘Developers’ tab.   (By default this tab is hidden but you can enable it by clicking on ‘File’ .  Select ‘Options’ ,‘Customize Ribbon’, and check the ‘Developers’ tab to true.
 
To record a macro we  click ‘Record Macro…’
 
Record Macro form to enter name of macro
 
Let’s the name the macro.  Remember that I want to  turn on the ‘Show Bookmarks’ option.   (Note, do not use spaces or punctuation).
 
 
By default the macro should be saved in the ‘Normal' template.  This will make it available globally, that is to all the documents you open.  If ‘Normal.dot’ is not selected in the ‘Store macro in:’ drop-down, you can click the drop-down and select it:
 
Record Macro screen lets you select where to store your macro.
 
(You can also save your macros in a custom template.  More about that in a later post.)
 
Click ‘OK’  You will see the cursor change to an arrow with a recording tape.  
Now we are ready to start recording.
 
To find the ‘Show Bookmarks’ option we need to go to the File Tab and click on ‘Options’
 
Check 'Show Bookmarks' in File options
 
Click the ‘Show bookmarks’ check box.  Scroll down and click the ‘OK’ button.   
 
View Tab / Macros drop-down / Stop Recording.
 
Click the View Tab/ Macros drop-down (or 'Developer' tab).
Click ‘Stop Recording’
Click ‘View Macros’ to see the macro we just created:
 
 
Click the ‘Edit’ button to open the macro editor.  This is the macro:
 
ShowBookmarks one line  macro
 
Just one line of code, and nothing mysterious:  “ShowBookmarks = True”.  That’s it!

We could repeat the above process for a macro to hide the bookmarks.  Or, we could just copy and paste the macro, change the name to “HideBookmarks” and change ‘True’ to ‘False’.

Here are both macros together:
 
View show and hide bookmarks in macro editor.
 
Close the macro editor.
 
Now test the macros.  Select some content and insert a bookmark.  Select the 'ShowBookmarks' macro from the View Macros list and click ‘Run’
 
Run macro button in Macros list
 

Here is an example of Bookmarks turned on:
 
And now turned back off:

 
 
 
 
 

 

 

 

Copy/Paste a Macro

Comments 1

 
Guest - Sagiv on Sunday, 23 July 2017 15:07

Thanks for the post.
How could I write a "word Macro" for:
File --> SHare --> Email --> Send as PDF ?
Thanks!

Thanks for the post. How could I write a "word Macro" for: File --> SHare --> Email --> Send as PDF ? Thanks!
Already Registered? Login Here
Guest
Saturday, 21 October 2017

Search Our Blog

Schedule a Custom Demo

Explore the versatility and simplicity of Expedience Software.

Schedule Demo

Go to top