![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#6
|
||||
|
||||
|
To do what you want would probably require you to:
1. create a document variable or custom document property in the template 2. when you create a new document from the template, update the new document's copy of the document variable or custom document property 3. have the code in your userform read the document variable or custom document property in the activedocument and check the appropriate button programmatically. I'm not sure whether the AutoNew macro you now have would fire before the document variable or custom document property is updated. If it does, you wouldn't be able to use the AutoNew macro; instead you'd need to update the document variable or custom document property then call another macro to load the userform via Application.Run. For example, in your 'Cleaned VBA Document' document: Code:
'Code to populate the document variable or custom document property, then Application.Run ActiveDocument.AttachedTemplate.FullName & "!Module1.LoadUserForm"
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Checkbox in Userform
|
lukael | Excel Programming | 5 | 02-18-2014 05:20 AM |
| Userform Code not quite right - help please | vbanovice | Word VBA | 1 | 09-29-2013 09:20 PM |
Show userform without losing document focus? Or other method to get a graphic to pop?
|
AlexR | Word VBA | 7 | 03-31-2013 12:17 PM |
How to link userform to another word document
|
SaneMan | Word VBA | 5 | 10-14-2011 05:12 AM |
Setting focus to specific word document from UserForm
|
SaneMan | Word VBA | 5 | 04-01-2011 03:11 PM |