Trying to put a Command Button into a Toolbar for a Template

G

GLT

Hi,

I have created a Word template and created a macro that runs some VB code
which inserts a link which includes todays date into the document
automatically.

The code works fine. I then create a new toolbar with a button that runs
the macro code.

Everytime I try to save the template with the new toolbar and re-open it,
the new tool bar is completely missing.

Does anyone know what Word is doing here?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?R0xU?=,
I have created a Word template and created a macro that runs some VB code
which inserts a link which includes todays date into the document
automatically.

The code works fine. I then create a new toolbar with a button that runs
the macro code.

Everytime I try to save the template with the new toolbar and re-open it,
the new tool bar is completely missing.
The most common reason for this is that the toolbar was not saved in the
template with the macro code, but in the default (Normal.dot) template. Are
you certain your template is selected from the dropdown list when you create
the new toolbar?

And also when you assign the macro to a toolbar button?

And you have checked in the View/Toolbars list?

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 :)
 
G

GLT

Hi Cindy,

Thanks for your advise.

I have worked out what I was doing wrong. Every time I opened my template I
double clicked on the template document which then opened it as a .doc
document.

I now open the template via the File>Open and it remains a template which
then allows me to update and save it.

Thanks for your help,
GLT.
 
W

Word Heretic

G'day GLT <[email protected]>,

You have to set the customization context (Save the changes in...) to
your template before making the modification.

At the moment, you have probably snarled up normal.dot, your word data
key in the registry and your template. Additionally, you should name
your new commandbars soon after creation by using some Immediate
Window VBA.


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


GLT reckoned:
 

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