Command Button Code in Template not available in Document

B

Blech

I have some code attached to a command button's Click event that I
created in a document template that is not present in a document based
on that template. How do I make the command button's code available
to all documents based on the template containing the command button
code?

Thanks,

Geoff
 
A

Anne Troy

Sounds to me like you've got code in the Document_New event that you didn't
put int he Document_Open event. If you want the same stuff available in a
document that is created from a template, you have to put it in BOTH of
these events.
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
Hope this helps!
Anne Troy (better known as Dreamboat)
Web: www.VBAExpress.com
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
 
B

Blech

Anne Troy said:
Sounds to me like you've got code in the Document_New event that you didn't
put int he Document_Open event. If you want the same stuff available in a
document that is created from a template, you have to put it in BOTH of
these events.
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
Hope this helps!
Anne Troy (better known as Dreamboat)
Web: www.VBAExpress.com
<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->

I have some code in the Document_New event that's in a document based
on the template, but I also have code for a Command button's click
event. So are you saying I must put some code (the same code?) in
both the Template's Document_New and Document_Open events in order to
have the Command Button Click code available to a document? I'm
really wondering how I get the Command Button Click code to propagate
from the Template to the Document.

Thanks,

Geoff
 
C

Cindy M -WordMVP-

Hi Blech,
I have some code attached to a command button's Click event that I
created in a document template that is not present in a document based
on that template. How do I make the command button's code available
to all documents based on the template containing the command button
code?
I wrote an article for MSDN some time back on using ActiveX controls in
Word documents. It also touches on control location vs. code location.
See if the information in that article helps at all?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
E

Eliot

Hi Blech,

I wrote an article for MSDN some time back on using ActiveX controls in
Word documents. It also touches on control location vs. code location.
See if the information in that article helps at all?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
B

Blech

Cindy M -WordMVP- said:
Hi Blech,

I wrote an article for MSDN some time back on using ActiveX controls in
Word documents. It also touches on control location vs. code location.
See if the information in that article helps at all?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)

Thanks Cindy - I didn't mention that the Word document is being
launched from Goldmine. It appears that is the reason I was having
problems.

Thanks again,

Geoff
 

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