View Single Post
 
Old 09-03-2013, 03:43 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Variables aren't on documents. You have add a DocVariable field to the document e.g., {DocVariable SomeDocumentName} then call an auto procedure then the document is opened or a new document is created from the template:

Code:
Sub Document_New()
ActiveDocument.Variables("SomeVariableName").Value = InputBox("Enter the variable value")
ActiveDocument.Fields.Update
End Sub
Sub Document_Open()
ActiveDocument.Variables("SomeVariableName").Value = InputBox("Enter the variable value")
ActiveDocument.Fields.Update
End Sub
You could also use a bookmark, content controls, formfields or a userform:
http://gregmaxey.com/word_tip_pages/..._userForm.html
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote