Can I run a macro from a filled-in form?

B

Barbara Hill

I am using Word 2007. We have a lot of forms on paper that users have sent to
us. My job is to transcribe them. I have created a template for myself that
mimics the paper. So far so good. The Word form has a text control at the top
that I use to fill in a serial number (001, 002, etc.). I have assigned a
bookmark name of SurveyNum to that control. I have written a little macro in
the form template that saves the file as <SurveyNum>.doc. This macro is doing
exactly what I want when I have it open in the VB editor and run it with a
completed form as the active document.

What I really want to do is fill in the form, hit my shortcut key, and have
the form get saved as <SurveyNum>.doc. How can I get this to happen?

I have saved my template with forms protection turned on, so that a new
document based on the template starts out in form-filling-out mode. This
seems to prevent me from using my macro. I am pretty confused about how all
the security stuff fits together. Help, please!

(Maybe I should also mention that my client is using Word 2003. So to the
greatest degree possible I want to keep things compatible with their version.
I created the form for myself on one of their computers, so it has Word 2003
form fields. This seems to be OK, but maybe it isn't really, given what I
want to do with the macro. The template is now a Word 2007 macro-enabled
template.)

Help! Thanks!
 
B

Barbara Hill

Oh, I have stumbled upon the answer to my own question. I had made a mistake
when saving my template. I saved it in the Templates folder as a
macro-enabled document instead of as a macro-enabled template. Now that I
have saved it correctly, life is beautiful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top