Running a macro when template opened? 
Author Message
 Running a macro when template opened?

How any body?

Cheers

- Al



Fri, 19 Sep 2003 02:45:48 GMT  
 Running a macro when template opened?
Hi Al,

When the template itself is opened in an editing window? When a document
based on a template is opened?

A bit more detail as to what you are trying to achieve makes it a whole lot
easier to frame a concise and helpful response.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> How any body?

> Cheers

> - Al



Fri, 19 Sep 2003 06:03:42 GMT  
 Running a macro when template opened?
Hi Jonathan,

Sorry for my berevity!!

When a New Document is Opened based on the Template?

Also, another question you may know the answer to,

I am populating a list box as follows:

For ExhNo = 1 to 999
CBoxExh.AddItem Exh
Next ExhNo

Now the problem is that I want 3 digit numbers in my list box, ie 001
instead of 1.

Any ideas?

Cheers

- Al



Quote:
>Hi Al,

>When the template itself is opened in an editing window? When a document
>based on a template is opened?

>A bit more detail as to what you are trying to achieve makes it a whole lot
>easier to frame a concise and helpful response.



Sat, 20 Sep 2003 13:53:38 GMT  
 Running a macro when template opened?
Hi Al,


Quote:
> Hi Jonathan,

> Sorry for my berevity!!

That's OK. I have anough information now.

Quote:

> When a New Document is Opened based on the Template?

Create a macro in the tamplate named AutoNew. It will run when you create a
new document based on the template.

Alterntively, if you want a macro to run when you open an existiong document
based on the template, then name your macro AutoOpen.

Quote:

> Also, another question you may know the answer to,

> I am populating a list box as follows:

> For ExhNo = 1 to 999
> CBoxExh.AddItem Exh
> Next ExhNo

> Now the problem is that I want 3 digit numbers in my list box, ie 001
> instead of 1.

I've answered this in your separate post. When you have several questions,
its better to put each one in a separate post. That way, people can more
easily see which ones haven't yet been answered, and you are more likely to
get answers to everything.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email



Sat, 20 Sep 2003 15:04:52 GMT  
 Running a macro when template opened?
Hi Jonathan,

I have a question related to this thread. I usually open an existing
document and then attach a specific template. Will AutoOpen (existing in the
specific template) run when the template is attached?

Quote:
> Alterntively, if you want a macro to run when you open an existiong
document
> based on the template, then name your macro AutoOpen.

How can I open an existing document based on a template? Does the document
have to be saved with the template attached and then when opened it works?

Thanks,
Kathleen


Quote:
> Hi Al,



> > Hi Jonathan,

> > Sorry for my berevity!!

> That's OK. I have anough information now.

> > When a New Document is Opened based on the Template?

> Create a macro in the tamplate named AutoNew. It will run when you create
a
> new document based on the template.

> Alterntively, if you want a macro to run when you open an existiong
document
> based on the template, then name your macro AutoOpen.

> > Also, another question you may know the answer to,

> > I am populating a list box as follows:

> > For ExhNo = 1 to 999
> > CBoxExh.AddItem Exh
> > Next ExhNo

> > Now the problem is that I want 3 digit numbers in my list box, ie 001
> > instead of 1.

> I've answered this in your separate post. When you have several questions,
> its better to put each one in a separate post. That way, people can more
> easily see which ones haven't yet been answered, and you are more likely
to
> get answers to everything.

> --
> Regards
> Jonathan West - Word MVP
> MultiLinker - Automated generation of hyperlinks in Word
> Conversion to PDF & HTML
> http://www.multilinker.com
> Word FAQs at http://www.multilinker.com/wordfaq
> Please post any follow-up in the newsgroup. I do not reply to Word
questions
> by email



Sat, 20 Sep 2003 20:34:55 GMT  
 Running a macro when template opened?


Quote:
> Hi Jonathan,

> I have a question related to this thread. I usually open an existing
> document and then attach a specific template. Will AutoOpen (existing in
the
> specific template) run when the template is attached?

No it doesn't

Quote:

> > Alterntively, if you want a macro to run when you open an existiong
> document
> > based on the template, then name your macro AutoOpen.

> How can I open an existing document based on a template? Does the document
> have to be saved with the template attached and then when opened it works?

Every document is based on a template. You can tell which template is the
"attached template" by looking in Tools, Templates and Add-ins.

You can create a new document based on a template by going to File, New, and
selecting the template from the list available. When you do this, if the
template has an AutoNew macro, it will run.

Likewise, if you save the document, close it and later re-open it, AutoOpen
will run if present in the template.

The other advantage of creating a document based on a template is that a
created document inherits the template's styles, margins, text, and has
access to its macros and Autotext entries. Applying a template subsequently
only gives access to AutoText and macros, and allows for styles to be
inherited if you check the "Automatically update styles" box in Tools,
Templates and Add-ins.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email



Sat, 20 Sep 2003 20:11:04 GMT  
 Running a macro when template opened?
Hi Jonathan,

Thanks for your response. Unfortunately I do not have control over the
original documents. The documents are created and sent to us. We then attach
a template to run various cleaning, replacement and standardization
operations. I was just looking for a way that once a template was attached,
it could automatically perform something. I had been struggling with AutoNew
and AutoOpen to try to get something to work.

Thanks for your help.
Kathleen


Quote:



> > Hi Jonathan,

> > I have a question related to this thread. I usually open an existing
> > document and then attach a specific template. Will AutoOpen (existing in
> the
> > specific template) run when the template is attached?

> No it doesn't

> > > Alterntively, if you want a macro to run when you open an existiong
> > document
> > > based on the template, then name your macro AutoOpen.

> > How can I open an existing document based on a template? Does the
document
> > have to be saved with the template attached and then when opened it
works?

> Every document is based on a template. You can tell which template is the
> "attached template" by looking in Tools, Templates and Add-ins.

> You can create a new document based on a template by going to File, New,
and
> selecting the template from the list available. When you do this, if the
> template has an AutoNew macro, it will run.

> Likewise, if you save the document, close it and later re-open it,
AutoOpen
> will run if present in the template.

> The other advantage of creating a document based on a template is that a
> created document inherits the template's styles, margins, text, and has
> access to its macros and Autotext entries. Applying a template
subsequently
> only gives access to AutoText and macros, and allows for styles to be
> inherited if you check the "Automatically update styles" box in Tools,
> Templates and Add-ins.

> --
> Regards
> Jonathan West - Word MVP
> MultiLinker - Automated generation of hyperlinks in Word
> Conversion to PDF & HTML
> http://www.multilinker.com
> Word FAQs at http://www.multilinker.com/wordfaq
> Please post any follow-up in the newsgroup. I do not reply to Word
questions
> by email



Mon, 22 Sep 2003 21:29:01 GMT  
 Running a macro when template opened?
Hi Kathleen,

A different approach might be to have your macros in a global template,
placed in Word's Startup folder. That way the macros are always available,
and you don't need to attach the template to the document in order to run
the macros.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Hi Jonathan,

> Thanks for your response. Unfortunately I do not have control over the
> original documents. The documents are created and sent to us. We then
attach
> a template to run various cleaning, replacement and standardization
> operations. I was just looking for a way that once a template was
attached,
> it could automatically perform something. I had been struggling with
AutoNew
> and AutoOpen to try to get something to work.

> Thanks for your help.
> Kathleen





> > > Hi Jonathan,

> > > I have a question related to this thread. I usually open an existing
> > > document and then attach a specific template. Will AutoOpen (existing
in
> > the
> > > specific template) run when the template is attached?

> > No it doesn't

> > > > Alterntively, if you want a macro to run when you open an existiong
> > > document
> > > > based on the template, then name your macro AutoOpen.

> > > How can I open an existing document based on a template? Does the
> document
> > > have to be saved with the template attached and then when opened it
> works?

> > Every document is based on a template. You can tell which template is
the
> > "attached template" by looking in Tools, Templates and Add-ins.

> > You can create a new document based on a template by going to File, New,
> and
> > selecting the template from the list available. When you do this, if the
> > template has an AutoNew macro, it will run.

> > Likewise, if you save the document, close it and later re-open it,
> AutoOpen
> > will run if present in the template.

> > The other advantage of creating a document based on a template is that a
> > created document inherits the template's styles, margins, text, and has
> > access to its macros and Autotext entries. Applying a template
> subsequently
> > only gives access to AutoText and macros, and allows for styles to be
> > inherited if you check the "Automatically update styles" box in Tools,
> > Templates and Add-ins.

> > --
> > Regards
> > Jonathan West - Word MVP
> > MultiLinker - Automated generation of hyperlinks in Word
> > Conversion to PDF & HTML
> > http://www.multilinker.com
> > Word FAQs at http://www.multilinker.com/wordfaq
> > Please post any follow-up in the newsgroup. I do not reply to Word
> questions
> > by email



Mon, 22 Sep 2003 21:01:25 GMT  
 Running a macro when template opened?
Hi Kathleen,

See http://www.addbalance.com/usersguide/templates.htm for more information
about global templates.
--
Charles Kenyon

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

Legal Users' Guide to Microsoft Word (supplemented)
http://www.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.


Quote:
> Hi Kathleen,

> A different approach might be to have your macros in a global template,
> placed in Word's Startup folder. That way the macros are always available,
> and you don't need to attach the template to the document in order to run
> the macros.

> --
> Regards
> Jonathan West - Word MVP
> MultiLinker - Automated generation of hyperlinks in Word
> Conversion to PDF & HTML
> http://www.multilinker.com
> Word FAQs at http://www.multilinker.com/wordfaq
> Please post any follow-up in the newsgroup. I do not reply to Word
questions
> by email



> > Hi Jonathan,

> > Thanks for your response. Unfortunately I do not have control over the
> > original documents. The documents are created and sent to us. We then
> attach
> > a template to run various cleaning, replacement and standardization
> > operations. I was just looking for a way that once a template was
> attached,
> > it could automatically perform something. I had been struggling with
> AutoNew
> > and AutoOpen to try to get something to work.

> > Thanks for your help.
> > Kathleen





> > > > Hi Jonathan,

> > > > I have a question related to this thread. I usually open an existing
> > > > document and then attach a specific template. Will AutoOpen
(existing
> in
> > > the
> > > > specific template) run when the template is attached?

> > > No it doesn't

> > > > > Alterntively, if you want a macro to run when you open an
existiong
> > > > document
> > > > > based on the template, then name your macro AutoOpen.

> > > > How can I open an existing document based on a template? Does the
> > document
> > > > have to be saved with the template attached and then when opened it
> > works?

> > > Every document is based on a template. You can tell which template is
> the
> > > "attached template" by looking in Tools, Templates and Add-ins.

> > > You can create a new document based on a template by going to File,
New,
> > and
> > > selecting the template from the list available. When you do this, if
the
> > > template has an AutoNew macro, it will run.

> > > Likewise, if you save the document, close it and later re-open it,
> > AutoOpen
> > > will run if present in the template.

> > > The other advantage of creating a document based on a template is that
a
> > > created document inherits the template's styles, margins, text, and
has
> > > access to its macros and Autotext entries. Applying a template
> > subsequently
> > > only gives access to AutoText and macros, and allows for styles to be
> > > inherited if you check the "Automatically update styles" box in Tools,
> > > Templates and Add-ins.

> > > --
> > > Regards
> > > Jonathan West - Word MVP
> > > MultiLinker - Automated generation of hyperlinks in Word
> > > Conversion to PDF & HTML
> > > http://www.multilinker.com
> > > Word FAQs at http://www.multilinker.com/wordfaq
> > > Please post any follow-up in the newsgroup. I do not reply to Word
> > questions
> > > by email



Tue, 23 Sep 2003 12:59:10 GMT  
 Running a macro when template opened?
Jonathan, Charles,

Thanks for all the help! I will look into the global templates.

-Kathleen


Quote:
> Hi Kathleen,

> See http://www.addbalance.com/usersguide/templates.htm for more
information
> about global templates.
> --
> Charles Kenyon

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

> Legal Users' Guide to Microsoft Word (supplemented)
> http://www.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.



> > Hi Kathleen,

> > A different approach might be to have your macros in a global template,
> > placed in Word's Startup folder. That way the macros are always
available,
> > and you don't need to attach the template to the document in order to
run
> > the macros.

> > --
> > Regards
> > Jonathan West - Word MVP
> > MultiLinker - Automated generation of hyperlinks in Word
> > Conversion to PDF & HTML
> > http://www.multilinker.com
> > Word FAQs at http://www.multilinker.com/wordfaq
> > Please post any follow-up in the newsgroup. I do not reply to Word
> questions
> > by email



> > > Hi Jonathan,

> > > Thanks for your response. Unfortunately I do not have control over the
> > > original documents. The documents are created and sent to us. We then
> > attach
> > > a template to run various cleaning, replacement and standardization
> > > operations. I was just looking for a way that once a template was
> > attached,
> > > it could automatically perform something. I had been struggling with
> > AutoNew
> > > and AutoOpen to try to get something to work.

> > > Thanks for your help.
> > > Kathleen





> > > > > Hi Jonathan,

> > > > > I have a question related to this thread. I usually open an
existing
> > > > > document and then attach a specific template. Will AutoOpen
> (existing
> > in
> > > > the
> > > > > specific template) run when the template is attached?

> > > > No it doesn't

> > > > > > Alterntively, if you want a macro to run when you open an
> existiong
> > > > > document
> > > > > > based on the template, then name your macro AutoOpen.

> > > > > How can I open an existing document based on a template? Does the
> > > document
> > > > > have to be saved with the template attached and then when opened
it
> > > works?

> > > > Every document is based on a template. You can tell which template
is
> > the
> > > > "attached template" by looking in Tools, Templates and Add-ins.

> > > > You can create a new document based on a template by going to File,
> New,
> > > and
> > > > selecting the template from the list available. When you do this, if
> the
> > > > template has an AutoNew macro, it will run.

> > > > Likewise, if you save the document, close it and later re-open it,
> > > AutoOpen
> > > > will run if present in the template.

> > > > The other advantage of creating a document based on a template is
that
> a
> > > > created document inherits the template's styles, margins, text, and
> has
> > > > access to its macros and Autotext entries. Applying a template
> > > subsequently
> > > > only gives access to AutoText and macros, and allows for styles to
be
> > > > inherited if you check the "Automatically update styles" box in
Tools,
> > > > Templates and Add-ins.

> > > > --
> > > > Regards
> > > > Jonathan West - Word MVP
> > > > MultiLinker - Automated generation of hyperlinks in Word
> > > > Conversion to PDF & HTML
> > > > http://www.multilinker.com
> > > > Word FAQs at http://www.multilinker.com/wordfaq
> > > > Please post any follow-up in the newsgroup. I do not reply to Word
> > > questions
> > > > by email



Tue, 23 Sep 2003 20:45:33 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Open Word with template and macro by shell function

2. FileSave macro won't run in template

3. Error when running Macro from Global Template

4. Running a macro from a template

5. Running an auto macro from global template.

6. Running macro inside a template document

7. Word 2002 doesn't run Word2K template/macros

8. Running a macro from the Startup - template

9. Running Word, Opening a template from Access

10. Opening an excel file through a form/running excel macros through access

11. run a macro when app opens

12. Help Excel97 macro to run on file open or close

 

 
Powered by phpBB® Forum Software