Form Field Options, Run Macro On...

Z

Zamdrist

I have a VBA procedure in a module which I want to run on the Exit of a
Form Field.

The procedure name appears in the list of selectable procedures when I
design the template, and it runs just fine as a template.

However when I create a new document based on the template the
procedure doesn't run, and in fact when you unlock the form field,
there is no procedure defined in the Exit portion of the form field.

This is really odd, because I have other templates I run in the same
manner, and no issues!

I made sure that the procedure is a Public Sub, so that cannot be the
issue as I can see, that would be the most obvious, first problem. Also
I tried placing the procedure in the Class Module: ThisDocument, but
the results are the same...no procedure, nothing.

I'm really confuzzled over this one. I've done this same type of thing
before, plenty of times :-S

Any thoughts would be greatly appreciated. Thanks.

Steve
 
Z

Zamdrist

More:

When I open up the document, based on the template...although the
procedure doesn't show up in the Exit portion of the form field...the
procedure *is* in the document if I go to the VBA Editor, oddly enough.

Furthermore, if I edit the procedure, or just make a superfoulous
change to it...it then appears in the list of procedure in the form
field options!

Very odd.
 
C

Charles Kenyon

It sounds to me as if you've probably covered this, but just to make sure,
is your procedure in your template and not in normal.dot?

What is the name of your procedure?

Moving a procedure to a different module or renaming it will interfere with
(break) links to it from the interface. This may include on-exit macros.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Z

Zamdrist

Charles, thank you.

I think found my problem. This file originated as a plain document
(.doc). I've always assumed the only difference between a document and
a template, all other things being equal was simply the extention.

I believe at one time I just renamed the extension .dot from .doc
assuming that would be sufficient. Apparently it wasn't.

I created a new empty template (using file, new, template) and
copied/pasted in the content from my original file, and imported the
macro/procedure...and presto...the template works as it should now.

Looks like the techie out techied himself! LOL.

Thanks,

Steve
 
C

Charles Kenyon

You've discovered one part of the magic: Only Word can make a template. The
extension matters to Windows, but Word can tell the difference. You probably
could have done the same thing within Word saving it as a template.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Z

Zamdrist

So I was curious and created two identical empty files, one a document,
one a template and compared them using Textpad. There appears to be one
significant difference between the two:

< ÐÏࡱá
< 
< 
<
<
---
ÐÏࡱá



10c10
<

Where < represents a .doc and the > represents the .dot. The
Hexidecimal value 10c10 is what's different. Interesting.

This has nothing to do with my original project, and I should probably
get back on it :)
 

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