Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Form Field Options, Run Macro On...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zamdrist - 16 Mar 2006 18:42 GMT
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
Zamdrist - 16 Mar 2006 18:55 GMT
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.
Charles Kenyon - 16 Mar 2006 19:03 GMT
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.
Signature

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.

>I have a VBA procedure in a module which I want to run on the Exit of a
> Form Field.
[quoted text clipped - 20 lines]
>
> Steve
Zamdrist - 16 Mar 2006 19:24 GMT
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
Charles Kenyon - 16 Mar 2006 19:53 GMT
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.
Signature

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.

> Charles, thank you.
>
[quoted text clipped - 14 lines]
>
> Steve
Zamdrist - 16 Mar 2006 20:46 GMT
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 :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.