#1
|
|||
|
|||
Problem with attaching template in AutoNew sub
Hello!
I wrote a macro to automatically attaching template in new document: Code:
Sub AutoNew() ActiveDocument.AttachedTemplate = <Path To Template> ActiveDocument.UpdateStylesOnOpen = True End Sub Could you tell me what can I do? Thanks in advance |
#2
|
||||
|
||||
Why don't you use the template as intended and create new documents from it?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
I agree with Graham, this macro misses a lot of template functionality and the logistics of where you would need to store the macro means you should either be modifying the Normal.dotm template styles or creating a new doc from a specific template.
UpdateStylesOnOpen does exactly that. You would need to close and reopen the document to see the effect of that instruction. If you want an instant effect with importing the AttachedTemplate styles you should use this instead. ActiveDocument.UpdateStyles
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
||||
|
||||
Cross-posted at: vba - Problem with attaching template in AutoNew sub - Stack Overflow
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
I responded in Stack Overflow. Please read the link on etiquette posted by Macropod.
|
Tags |
autonew, styles, template |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro added to Ribbon in template does not appear after attaching template | rocky2 | Word VBA | 1 | 04-04-2016 12:00 AM |
Attaching files | Andy Curshen | Outlook | 0 | 01-21-2016 12:48 PM |
Image is attaching | ANH | Mail Merge | 1 | 09-30-2015 02:05 PM |
Attaching a folder | alamorchgirl | Misc | 0 | 06-16-2011 06:32 PM |
attaching (relative,logical or virtual) path to template word document | wissam | Mail Merge | 0 | 08-04-2009 05:09 AM |