S
Sammy
Hello, I'm using Word 03. I have a global template in my startup folder
which contains a company toolbar and associated macros. I'm trying to
create a form and associated code inside the global template so that when a
user clicks on the toolbar button, the form appears to allow the user to make
a selection and click OK (or cancel). When I go to customize the toolbar to
add the button, my initialize macro doesn't show up, I'm not sure what I am
missing. Do I need a macro in the NewMacros module of the global template to
open the form? Can you help me? thanks
I have the following code behind the form:
Private Sub btnOK_Click()
btnOKclicked = True
Me.Hide
End Sub
Private Sub btnCancel_Click()
btnOKclicked = False
Me.Hide
End Sub
Public Sub UserForm_Initialize()
With frmNumber
..opt1 = True
..opt1.SetFocus
End With
frmNumber.Show
End Sub
'NumOut1, 2 and 3 are the macros a user can select from the form.
Sub NumOut1()
ActiveDocument.CopyStylesFromTemplate Template:= _
"E:\Demo\Style Sheets\#1 Style Sheet.dot"
CommandBars("Paragraph Numbering").Visible = True
End Sub
Sub NumOut2()
ActiveDocument.CopyStylesFromTemplate Template:= _
"E:\Demo\Style Sheets\#2 Style Sheet.dot"
CommandBars("Paragraph Numbering").Visible = True
End Sub
Sub NumOut3()
ActiveDocument.CopyStylesFromTemplate Template:= _
"E:\Demo\Style Sheets\#3 Style Sheet.dot"
CommandBars("Paragraph Numbering").Visible = True
End Sub
which contains a company toolbar and associated macros. I'm trying to
create a form and associated code inside the global template so that when a
user clicks on the toolbar button, the form appears to allow the user to make
a selection and click OK (or cancel). When I go to customize the toolbar to
add the button, my initialize macro doesn't show up, I'm not sure what I am
missing. Do I need a macro in the NewMacros module of the global template to
open the form? Can you help me? thanks
I have the following code behind the form:
Private Sub btnOK_Click()
btnOKclicked = True
Me.Hide
End Sub
Private Sub btnCancel_Click()
btnOKclicked = False
Me.Hide
End Sub
Public Sub UserForm_Initialize()
With frmNumber
..opt1 = True
..opt1.SetFocus
End With
frmNumber.Show
End Sub
'NumOut1, 2 and 3 are the macros a user can select from the form.
Sub NumOut1()
ActiveDocument.CopyStylesFromTemplate Template:= _
"E:\Demo\Style Sheets\#1 Style Sheet.dot"
CommandBars("Paragraph Numbering").Visible = True
End Sub
Sub NumOut2()
ActiveDocument.CopyStylesFromTemplate Template:= _
"E:\Demo\Style Sheets\#2 Style Sheet.dot"
CommandBars("Paragraph Numbering").Visible = True
End Sub
Sub NumOut3()
ActiveDocument.CopyStylesFromTemplate Template:= _
"E:\Demo\Style Sheets\#3 Style Sheet.dot"
CommandBars("Paragraph Numbering").Visible = True
End Sub