PDA

View Full Version : Solved: Template Macros Problems



kokain
07-10-2008, 08:54 AM
I am very new to VBA and macros. I usually code in Visual Studio, but I need a Word form Template. I have tried alot of code to do what I want but can't get anything to work. Here is a list of my problems (only the ones that relate to VBA):

1. The code in AutoOpen dosn't load my DropDown
2. Even if there is text in Text1 it still popps up to tell me there isn't
3. The code in the Class Module dosn't catch the "X" event (I got this code from another post on this forum)

See attached code. Please help me. I have no idea what I should do now.

Note: The Names.sys file is just a txt file with few names, one on each line. All of the passwords are "Q" (no quotation marks). I had to change the name of the .dot file to a .doc due to the upload restrictions. I just right-click renamed it. I am a big pain in the neck. For anyone who helps me, you deserve a medal.

kokain
07-10-2008, 09:48 AM
I think I now have it all working when it is a .doc

I had a few mistakes in there. But I am still unable to get it to work fully as a .dot

I don't think the AutoOpen fires when it is a Template. How do I get it to catch?

kokain
07-11-2008, 09:13 AM
I got it. For a template, you have to use Document_New. I was using AutoOpen which apperantly doesn't fire for a template.