Copying Word Theme to another document using Excel VBA

12seth12

New Member
Joined
Oct 5, 2015
Messages
3
Hi,

Is there a way to use VBA to save the current Word Document's Theme as a file in a location that I choose?

Essentially VBA code to do the same as clicking on this:
Save_Theme_Button.png


Background: I'm working on an Excel macro that uses VBA coding to take a template document, make a copy of it and replace several items within the copy. My problem is the new copy doesn't have the same theme as the original (i.e. accent colors, etc.). My current setup: I've manually saved the theme ".thmx" somewhere and I'm using this line to load the saved theme: myDocument.ApplyDocumentTheme Filename:=myThemeLocation which works. I'm now trying to use VBA to save the original document's theme in case I change the theme later on.

My plan is to use this code so the macro opens template document, saves theme somewhere, apply it to copied document, then deletes the saved theme.

I'm using Word and Excel 2010.

Thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,216,076
Messages
6,128,670
Members
449,463
Latest member
Jojomen56

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top