A simple macro to copy styles from one doc to another

AUTHOR:  JASON MORRELL 

Jason Morrell

Reading Time:
  minutes remaining

Who needs this macro?

You may be wondering:

How do I copy styles from one document and another,

or a slight variation ...

How do I copy styles between Word documents without having to recreate them all again? 

One approach is to use the Styles Organiser to first copy styles from the source document to the Normal template, then copy styles again from the Normal template to the destination document.

However, if your styles are well established in a category, e.g. a library of training manuals, that all follow the same format, then you can create the following macro and attach it to a Quick Access icon to make the process one-click-simple.

Here's the process to set that up.

Step #1: Create the master document

1.  Create and save a master document that contains all your master styles. You may save the file as docx or dotx. It makes no difference to this process.

2.  Open File Explorer and get the full path and filename of your master document as follows:

a) How to obtain the full pathname in Windows 10

If you are using Windows 10, locate your document then click in the address bar to see the full path and filename. 

How to get the full path and filename in Windows 10

b) How to obtain the full pathname in Windows 11

If you are using Windows 11, locate your document then right-click it and choose Copy as path

Save as path

Step #2: Create the macro code

3.  In any document press Alt F11 to open the Visual Basic Editor. Depending on your keyboard setup, you may need to press Fn Alt F11.

4.  On the left sidebar click Normal to select it, then select the Insert menu and choose Module,

Create a new macro module in the Normal template

5.  In the main code window paste the following code, replacing xxxxx with the full path and file name from step 2 above.

Sub Copy_styles_from_master_doc()
    ActiveDocument.CopyStylesFromTemplate _
    Template:="xxxxx"
End Sub

6.  Press F4 (if necessary) to display the Properties window on the left sidebar.

7.  Next to (Name), type Copy_styles_from_master_doc - you can use any name but spaces aren't allowed.

8.  Click X to close the code window. Changes are saved automatically.

Create VBA module

Step #3: Create an icon to run the macro

9.  Back in Word, click File | Options | Quick Access Toolbar.

10. Change Popular Commands to Macros.

11. Select the Normal.Copy_styles_from_master_doc macro.

12. Click Add >> between the 2 lists.

13. (Optional) Click Modify under the right-hand list.

14. (Optional) Choose any icon you like.

15. (Optional) Change the Display Name if you want.

16. Click OK to close the Symbol dialog. 

17. Click OK to close the Word Options dialog. 

Add the macro to the Quick Access Toolbar (QAT) and if you want, change the icon and display name

The new icon to run the macro is now situated in the QAT.

Now, in any document, when you click the macro icon, all the styles from the master doc are copied to the current doc. 

Now, with one click of the macro icon in the QAT, you can run the macro to update all the styles in the current document with those from the master document

Any styles that already exist in the current document will be updated.

Any styles that do not exist in the current document will be added.

There are no confirmations or warnings.

What Next?

Please feel free to post any questions you have into the comments below. And before you leave this page, I want to give you one quick little action item! 

ACTION ITEM: Comment below with ONE thing you picked up from this post and share how it has helped, or will help, you. It's good to share your successes because it encourages others and provides an instant boost.

Enjoy the rest of your day!

Jason Morrell blog signature
About Jason Morrell

About the author

Jason Morrell


Jason loves to simplify the hard stuff, cut the fluff and share what actually works. Things that make a difference. Things that slash hours from your daily work tasks. He runs a software training business in Queensland, Australia, lives on the Gold Coast with his wife and 4 kids and often talks about himself in the third person!

SHARE

POPULAR WORD POSTS

How to set up Multilevel numbering that works first time


Construct a Table of Contents that doesn't break and self-updates


2 ways to create a back of page Index


How to design Custom Watermarks


Add a magazine-style Drop-Cap

«« SEE ALL WORD POSTS »»

Office Legends Academy | Making Office Legends

Master Microsoft Office
in 30 days or less

more from

Office Mastery logo
Read More
Word Index Field Switches
Read More
Easily Create a Table of Figures in Word Without the Stress
Read More
How to Construct a Table of Contents in Word That Doesn’t Break and Self-Updates
Read More
2 Ways to Build a Dynamic Microsoft Word Index Page

JOIN THE DISCUSSION

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>