Quote:
Originally Posted by macropod
Your template should have code to trigger the userform via both a Document_New macro and a Document_Open macro.
|
So obvious in hindsight. But...it usually is. Thanks a lot macropod. It worked perfectly.
I just did a copy and paste of my "Open" code and changed it to "New" as shown below. Was this the proper way of doing it?
Quote:
Private Sub Document_Open()
Dim oCC As ContentControl
Set oCC = ActiveDocument.SelectContentControlsByTitle("Your Name").Item(1)
oCC.Type = wdContentControlText
oCC.Range.Text = Application.UserName
oCC.Type = wdContentControlDropdownList
Document_ContentControlOnExit oCC, False
Load DrawingNumberEntryForm
DrawingNumberEntryForm.Show
lbl_Exit:
Exit Sub
End Sub
Private Sub Document_New()
Dim oCC As ContentControl
Set oCC = ActiveDocument.SelectContentControlsByTitle("Your Name").Item(1)
oCC.Type = wdContentControlText
oCC.Range.Text = Application.UserName
oCC.Type = wdContentControlDropdownList
Document_ContentControlOnExit oCC, False
Load DrawingNumberEntryForm
DrawingNumberEntryForm.Show
lbl_Exit:
Exit Sub
End Sub
|