Bill Longo
2009-01-29 04:53:00 UTC
Hi,
I'm putting macros into a whole bunch of Word templates. Wanting to make a
userform global to a whole lot of other templates, I put the form
('frmLetter') into another WORD template called 'LetterDetails.dot' which
I've included as an addin.
However, I can't seem to call up 'frmLetter' from the bunch of templates.
The addin, 'LetterDetails.dot' is pointed to correctly. Infact I've set up a
test SUB in 'LetterDetails.dot' and have called that SUB from the bunch of
WORD templates and it works, so I know the addin is added in and
Application.Run("SUB name") wonderfully. I just can't access the userform.
I can get a reference from
ActiveDocument.VBProject.References("TemplateProject"), but I can't drill
into it to find 'frmLetter'.
I can iterate through VBA.UserForms displaying the names but 'frmLetter'
doesn't appear. I believe VBA.UserForms only shows loaded forms, so I guess
'frmLetter' isn't loaded yet.
I put a SUB in 'LetterDetails.dot' with the command 'frmLetter.Show()'. I
can get into the SUB to but it doesn't open up 'frmLetter'
I've tried VBA.UserForms.Add('frmLetter') but that didn't work.
I'm putting macros into a whole bunch of Word templates. Wanting to make a
userform global to a whole lot of other templates, I put the form
('frmLetter') into another WORD template called 'LetterDetails.dot' which
I've included as an addin.
However, I can't seem to call up 'frmLetter' from the bunch of templates.
The addin, 'LetterDetails.dot' is pointed to correctly. Infact I've set up a
test SUB in 'LetterDetails.dot' and have called that SUB from the bunch of
WORD templates and it works, so I know the addin is added in and
Application.Run("SUB name") wonderfully. I just can't access the userform.
I can get a reference from
ActiveDocument.VBProject.References("TemplateProject"), but I can't drill
into it to find 'frmLetter'.
I can iterate through VBA.UserForms displaying the names but 'frmLetter'
doesn't appear. I believe VBA.UserForms only shows loaded forms, so I guess
'frmLetter' isn't loaded yet.
I put a SUB in 'LetterDetails.dot' with the command 'frmLetter.Show()'. I
can get into the SUB to but it doesn't open up 'frmLetter'
I've tried VBA.UserForms.Add('frmLetter') but that didn't work.