View Single Post
 
Old 05-09-2014, 09:08 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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"
where 'LoadUserForm' is the macro name in the 'process document' template.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote