Snag. I am at home and the problem templates are at work! I am
wondering if when I click OK and unload the userform to generate my
document, I should be doing something else at that point. Should
another line of code follow the Unload Me line?
Thanks
Dave
> Snag. I am at home and the problem templates are at work! I am wondering
> if when I click OK and unload the userform to generate my document, I
> should be doing something else at that point. Should another line of code
> follow the Unload Me line?
No, Unload Me is the right thing to use to close the UserForm.
Something else, somewhere, must be causing the Userform to show up again
when the document is opened. The two obvious candidates are an Auto macro,
or an event proceure.
There's a way we can smoke this out. Change the name of the form in the
properties pane in the VBA editor from frmLetter to something else, and make
the matching change in the AutoNew macro. Make no other changes at all. Save
the template and then try to reproduce the problem. With any luck, you will
trigger an error as some piece of code tries to run a nonexistent form.
Track it down and work out what needs to be changed.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Dave - 12 Mar 2005 06:50 GMT
Excellent idea. I will try that on Monday.
Thanks
David
>> Snag. I am at home and the problem templates are at work! I am
>> wondering if when I click OK and unload the userform to generate my
[quoted text clipped - 13 lines]
> luck, you will trigger an error as some piece of code tries to run a
> nonexistent form. Track it down and work out what needs to be changed.