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 / November 2004

Tip: Looking for answers? Try searching our database.

Template and macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marek - 17 Nov 2004 12:35 GMT
My Template (.dot) have macro. It saved current filled template into doc.
Macro is in template as Commandbutton1_Click().
When i save document as template and reopen it by double click, it opens as
project1.
Then button is doesn't run (but it's not blocked)
What i must do?
Jean-Guy Marcil - 17 Nov 2004 15:20 GMT
Marek was telling us:
Marek nous racontait que :

> My Template (.dot) have macro. It saved current filled template into
> doc. Macro is in template as Commandbutton1_Click().
> When i save document as template and reopen it by double click, it
> opens as project1.
> Then button is doesn't run (but it's not blocked)
> What i must do?

See
http://word.mvps.org/faqs/customization/CreateATemplatePart1.htm
for help on understanding how to use a template.

Here is one way of doing what I think you want to do:
In your case, I think you have to create the template that contains the
general lay out of your in-line form (including the button, but not the
code).
Then, generate a document from it,. Since you will be ending this form to
people al over the place (and that they will not have the template), attach
your document to the Normal.dot template (Tools > Templates and Add-ins...).
Then add the code to the button (In design mode, double click on the button
to access to Code pane).

Be warned that if your user have set their security to High, your code will
be deactivated and there is nothing you can do. You may want to include a
comment telling users that if they want to use the "Send" button, they have
to set their security to Medium or lower (Tools > Macros > Security). At
Medium they will be prompted to activate the macros or not.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Marek - 18 Nov 2004 07:58 GMT
Thank you very much!
It works fine :)

> Marek was telling us:
> Marek nous racontait que :
[quoted text clipped - 26 lines]
>  > Security). At Medium they will be prompted to activate the macros or
> not.

Rate this thread:






 
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.