#1
|
|||
|
|||
Copying style from normal template into current documet
Dear All,
This may be a newbie question, but I cannot seem to figure out how to do this. I have a style in the global normal.dotm template, "Comment Text" that I would like to copy into the current document. When I use the following code, Word simply crashes, however: Code:
Application.OrganizerCopy Source:= _ NormalTemplate _ , Destination:=ActiveDocument, Name:="Comment Text", Object:= _ wdOrganizerObjectStyles Many thanks, tamasig Last edited by Charles Kenyon; 01-04-2020 at 12:40 PM. Reason: Change title to give better info about question and mark as solved |
#2
|
|||
|
|||
It looks like you are missing the path for the source.
I recorded a macro and it showed this. Code:
Sub Macro1() Application.OrganizerCopy Source:="C:\Users\jeffb\AppData\Roaming\Microsoft\Templates\Normal.dotm", _ Destination:=ActiveDocument, Name:="Comment Text", Object:=wdOrganizerObjectStyles End Sub |
#3
|
|||
|
|||
Thanks, @jeffreybrown. Because I wanted to write a code that is more general than specifying the actual path, I replaced the Source with NormalTemplate.FullName; however, even in that case Word crashed repeatedly. This kept happening until I also changed ActiveDocument to ActiveDocument.FullName.
The final code then is the following: Code:
Application.OrganizerCopy Source:=NormalTemplate.FullName, Destination:=ActiveDocument.FullName, Name:="Comment Text", Object:=wdOrganizerObjectStyles tamasig |
#4
|
|||
|
|||
I changed the title of this to show copying from the normal template rather than from a global template (add-in).
Here is my page on transferring from a global template. A Global StyleSheet in Microsoft Word? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert old pres with template applied to the current version of PowerPoint with a new template | dianahbr | PowerPoint | 0 | 02-21-2018 10:38 AM |
Copying paragraphs from multiple documents to the current one. | paik1002 | Word VBA | 3 | 02-22-2016 04:03 AM |
What happens when I delete the Global template? | jjmclell | Project | 2 | 05-10-2015 02:48 PM |
A macro to reveal keyboard shortcuts assigned to global template? | New Daddy | Word | 3 | 12-17-2013 07:08 AM |
Global template | ryalls3857 | Word | 1 | 12-27-2010 05:45 PM |