Re: Wd2003:AutoExit Macro Doesn't Restore Menu Items Customized by Aut by Tom
Tom
Wed Jan 12 08:38:03 CST 2005
A quick guess is that you need to watch what
Application.CustomizationContext is being set to. Remember, menu/toolbar
changes apply to a particular TEMPLATE, not the application as a whole. My
guess is that when you are first making your changes, you are applying the
changes to Normal.dot, but then when you are removing them, you are applying
the changes to YOUR template. While your template is still loaded, your
reinstated menu changes are still in effect. But close your template, and
you'll be back to the menu changes you first applied to Normal.dot.
Sorry if that's confusing. It's not the easiest thing to explain. Just look
into Application.CustomizationContext and make sure you've got it set
correctly before making changes to CommandBars. Also, one thing to think
about, why not just make change the the menus interactively (YOU do it, not
code) while your template is open and TOOLS | CUSTOMIZE is set to save
changes to your template. Then those menu changes will only appear while
your template is loaded. Then you don't need any fancy code. You could also
just run the code ONCE to make changes to your template, then save the
template. Then whenever you open the template, the menu changes should be
there. You won't need to run the code each time the template is opened.
--
Tom Winter
Tom@NoSpam.AmosFiveSix.com
"dinesh" <dinesh@discussions.microsoft.com> wrote in message
news:1092A1E3-171C-4A30-B6CE-F733BDE1C378@microsoft.com...
> I use a customized word 2003 template. In the AutoNew macro, I'm saving
the
> commandbar settings in registry, deleting all commmandbars and creating
some
> customized command bars. When the application is closed, the commandbar
> settings saved in the registry has to restored. I do it in the AutoExit
> macro. Apparently, this is not working. (This was early in Word 97. It was
> working fine.) When the AutoExit function is called, the commandbars are
> being reinstated, but once the word exit and I open word again, they are
not
> gone.
> For word 2000, microsoft have given the solution as to open the normal
> template and make the menu changes and save it. But this is not working in
> this case.