Macros running automatically from a template

  • Thread starter Thread starter Preet
  • Start date Start date
P

Preet

Hi

I have a template that will be opened from another application.
I have a macro in this template, and I wanted this to Automaticall
execute on opening of the template (the template is not saved in th
Add-in).

I dont know how I would do this, basically my application will ope
this template, then I wanted the macro attached to this template t
automatically start running as soon as the template is opened.

Please can anyone advise, I dont know VB, so any Sub AutoExec command
will need to be explained.

My current macro starts:

Sub Reqdata()

xxxxx

End Sub

After this I wouldnt know where to add the Sub AutoExec or the Publi
Sub AutoExec if needed?

Please can anyone help?

Sorry if this is a little confusing.

Thank you in advanc
 
Name the macro AutoExec.

--
Terry Farrell - Word MVP
http://word.mvps.org/

: Hi
:
: I have a template that will be opened from another application.
: I have a macro in this template, and I wanted this to Automatically
: execute on opening of the template (the template is not saved in the
: Add-in).
:
: I dont know how I would do this, basically my application will open
: this template, then I wanted the macro attached to this template to
: automatically start running as soon as the template is opened.
:
: Please can anyone advise, I dont know VB, so any Sub AutoExec commands
: will need to be explained.
:
: My current macro starts:
:
: Sub Reqdata()
:
: xxxxx
:
: End Sub
:
: After this I wouldnt know where to add the Sub AutoExec or the Public
: Sub AutoExec if needed?
:
: Please can anyone help?
:
: Sorry if this is a little confusing.
:
: Thank you in advance
:
:
: ---
: Message posted
:
 
No, name it AutoOpen if you really mean you're opening it; AutoNew if you're
creating a new document based on it. AutoExec will run every time Word is
started.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Oops! Yes. I keep getting those reversed!

Terry

: No, name it AutoOpen if you really mean you're opening it; AutoNew if
you're
: creating a new document based on it. AutoExec will run every time Word is
: started.
:
: --
: Suzanne S. Barnhill
: Microsoft MVP (Word)
: Words into Type
: Fairhope, Alabama USA
:
: Email cannot be acknowledged; please post all follow-ups to the newsgroup
so
: all may benefit.
:
: "TF" <terryfarrell%40%6d%73%6e%2ecom> wrote in message
: : > Name the macro AutoExec.
: >
: > --
: > Terry Farrell - Word MVP
: > http://word.mvps.org/
: >
: > : > : Hi
: > :
: > : I have a template that will be opened from another application.
: > : I have a macro in this template, and I wanted this to Automatically
: > : execute on opening of the template (the template is not saved in the
: > : Add-in).
: > :
: > : I dont know how I would do this, basically my application will open
: > : this template, then I wanted the macro attached to this template to
: > : automatically start running as soon as the template is opened.
: > :
: > : Please can anyone advise, I dont know VB, so any Sub AutoExec commands
: > : will need to be explained.
: > :
: > : My current macro starts:
: > :
: > : Sub Reqdata()
: > :
: > : xxxxx
: > :
: > : End Sub
: > :
: > : After this I wouldnt know where to add the Sub AutoExec or the Public
: > : Sub AutoExec if needed?
: > :
: > : Please can anyone help?
: > :
: > : Sorry if this is a little confusing.
: > :
: > : Thank you in advance
: > :
: > :
: > : ---
: > : Message posted
: > :
: >
: >
:
 
Back
Top