Hi Laura
The great culprit in this is usually the PDFMaker add-in supplied by Adobe
as part of Adobe Acrobat. Unfortunately, each of the last several versions
of Acrobat has found a different way to completely mess up other people's
menus on the menu bar. I would dearly love to find the person(s) responsible
at Adobe and shake them warmly by the throat!
Nothing is foolproof, but here are some tricks to avoid the worst of the
depredations of PDFMaker.
1. Don't position your menu at the end of the menu bar. Put it before the
Help menu. PDFMaker particularly seems to think of the last item on the menu
bar as its property if it isn't the Help menu.
2. Have your add-in check that the menus are right in your AutoExec macro
and in the DocumentBeforeClose event of Word's application object, and reset
them if necessary. PDFMaker in Acrobat 8 seems to reset its menus every time
a document is closed. Quite why it chooses this particular occasion is one
of the mysteries of life.
3. Give your your menus a specific Tag property so you can at least identify
your menus and work on them.
4. Always set the Application.CustomizationContext property to your add-in
before making any changes, and set it back to NormalTemplate after.
5. If you don't want you (or your users) forever to be prompted to save
changes to your add-in, set the Saved property to False immediately after
making changes to the menu.
6. Be aware that if the user is using Word as his Outlook email editor, and
creates or reads an email before creating or opening a regular Word
document, your add-in will load, but AutoExec will not run when the add-in
is loaded. Have AutoExec set a flag on completion. Have every macro in your
add-in check the value of the flag when it starts, and run AutoExec if the
flag has not been set.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
"Laura"
news:364BC7CE-BD5A-4FAF-B57A-318880D5F826@microsoft.com...
> Does anyone have a fool proof method for stabilizing custom menus (on the
> menu bar) in Word?
>
> I have a menu in a global template that should always show, as well as
> document templates that each contain a menu I want to appear only when
> someone is in a document created from that template.
>
> The problem SEEMS to stem from OTHER people's software -- the menus will
> be
> there but then they disappear, or multiple copies appear or the menu is
> suddenly empty or has the name for one menu with choices for another menu
> on
> it.
>
> Note: Custom TOOLBARS seem stable, it is just the MENU that is
> problematic.
>
> I have been fighting this for years and have done a lot of research but so
> far everything I try has a hiccup at some point. The programming is all
> VBA
> in Word .dot templates.
>
> So far I have tried:
> - Using tools, customize to create the menus w/in the appropriate
> templates
> -- works great on my computer, but menus disappear/duplicate constantly on
> about 80% of my clients.
>
> - Programmatically creating the menus -- this is good for the global
> template menu -- at first -- but somewhere through the day it gets
> trashed.
> I can't get the template specific menus to behave. They constantly
> disappear.
>
> - Write an event handler to delete and then recreate all menus and display
> as (Tried with the "Document change" or "WIndow Activate" event for the
> Word
> application) -- this seemed to work at first but suddenly the problems
> returned. I did not want to just "show" the menus per the event handler
> because they would suddenly have the wrong buttons or be empty part way
> through the day. (Maybe I am not writing it right.)
>
> Has anyone else had this struggle? It happens to me so much I am
> surprised
> I can't find more postings about it. PLEASE HELP!!!!! Thanks so much.