Adding a custom Menu to Menu Bar

J

jag

I have added a menu item to the menu bar, but cannot get it to stay there. I
have put it on a custom template, but once you run the template and it
becomes a regular document, the menu item is gone. I need for it to stay
there because it is there for the form user to access to start a merge
sequence. I prefer to add a menu instead of a toolbar button because they
keep moving / losing the toolbars.

Any help is appreciated.

Thanks,
Mary
 
J

Jonathan West

Inbar said:
Why not put it in normal.dot?

This article describes why not

Distributing macros to other users
http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


The problem is how to keep the menu available.

One option is to put it in an add-in which is loaded into the startup folder
and therefore is permanently available.

Another option is to ensure that when the template "becomes a regular
document" it is based on the original template and so has its toolbars &
menus available.

Mary, could you describe in a bit more detail what exactly you are doing?
That will make it easier to work out what solution to suggest.
 
J

jag

Thanks for your help. I knew I didn't want it in the normal.dot. I have it
associated with the specific template.

This project involves about 50 templates. I am trying to add a menu item to
start a macro that will merge part of the content of a different template
into a certain location in the open document - the open doc was created from
one of the 50 templates.

It is weird, the menu item is there, but on initial startup it is gone. I
can go to the customize dialogue box and it immediately comes back. I can't
seem to get it to stay on the template or the doc it creates.

I played with some of the things you suggested but no success. How do you
make sure that the doc is based on the template other than the fact that it
was created by running that template? Is there some option I am missing?

Thanks,
Mary
 
J

Jonathan West

jag said:
Thanks for your help. I knew I didn't want it in the normal.dot. I have it
associated with the specific template.

This project involves about 50 templates. I am trying to add a menu item
to
start a macro that will merge part of the content of a different template
into a certain location in the open document - the open doc was created
from
one of the 50 templates.

It is weird, the menu item is there, but on initial startup it is gone. I
can go to the customize dialogue box and it immediately comes back. I
can't
seem to get it to stay on the template or the doc it creates.

I played with some of the things you suggested but no success. How do you
make sure that the doc is based on the template other than the fact that
it
was created by running that template? Is there some option I am missing?

In VBA, you ensure that the ActiveDocument.AttachedTemplate property points
to the correct template.

If it does, then you also ensure that the Visible property of the relevant
control is set to True.

As you haven't shown us any of the VBA code you have written so far that
generates the document, it's hard to know where you might be going wrong.

As a general principle, a menu or toolbar will only be available if the
template it is stored in is currently loaded. A template is loaded in any of
the following circumstances

1. It is normal.dot
2. Is it an add-in currently loaded in the Tools, Templates and Add-ins
dialog
3. It is the template attached to the currently open document.
 
J

jag

Thanks for your help. Actually, my husband and I are working together on this
project. He does the code. I do the formatting of the templates. He normally
posts any questions. I was trying to help and set something within Word. I
will show him what you wrote.

Thanks,
Mary
 

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