Customization Context causing error when not set to NormalTemplate

L

Laura

Hi All,

I have an autonew macro in a couple Word 2003 templates that creates a menu
that is visible when the end user is a document based on that template.

The reason I need to create the menu programmatically is because they have
Adobe Acrobat installed and it keeps trashing menus that I create /out VBA in
the template.

I had set the customization context to the document being created because
this made it appear only when the user was in the document. It works fine on
9 out of 10 computers in our office.

However, on one computer, each time I use the template, when I close the
doc, I get a runtime Error that mentions WinWord.exe and says

"The application has requested the runtime to terminate in an unusual way."

It then immediately kills word and any open docs are closed without saving.

If I set the customization context to NormalTemplate after creating the
menu, I do not get the error. However, that makes my menu disappear. If I
use NormalTemplate all along, the menu then shows in ALL documents. (Not
good.)

For now, I made an AutoClose macro that sets the customization context to
NormalTemplate as they close the document and all is well. BUT I'm wondering
if anyone has seen this? Any ideas what could cause it? Am I even
approaching my menu issue the right way?

Thanks so much.
 
J

Jezebel

First: depending on what version of Acrobat you're fighting, you might be
able to work around the problem by re-naming your add-ins. Word loads them
in reverse alpha order, so if you name it something less than whatever
Acrobat's add-in is called, yours is loaded later (so you can trash their
menus instead, if you want).

Failing that, the CustomizationContext is a challenge. When I met the
situation you describe, not only did Word just abort, it always wrecked any
templates open at the time. It's a bug in Word that has something to do with
situations where a toolbar in one template is customized by another
template. The sequence (in my case) was something like: customize a toolbar
in normal.dot; then customize the same toolbar in an add-in; then in code in
the add-in open a document based on a template other than normal, set the
customizationcontext to the that document's template and customize the
toolbar again. I just gave up trying to do that sort of customization on the
fly.
 
L

Laura

Jezebel,

Thanks for the reply. If nothing else, it's good to know I'm not the only
person who has encountered this type of thing!

I'm a little confused because the menu that Adobe is trashing is one in
documents where the templates are used once Word is open: "New Letter" "New
Memo" etc. So I would think Adobe would be fully loaded already, but those
menus, when just placed in the template, often just don't appear. Wherease
my menu that comes from my startup template that does load with Word USUALLY
is just fine.
 

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