--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"DeanH" <De...@discussions.microsoft.com> wrote in message
news:809B2CC7-0577-4D31...@microsoft.com...
"Graham Mayor" wrote:
> .
>
It could explain the missing menus and I have seen it in a number of
situations. If – after your External.dot is loaded, the CustomizationContext
is set to e.g. External.dot, that would most likely cause the Acrobat menus
to disappear.
Try this:
After starting Word (and when the menus are missing), go to the VBE
(Alt+F11). In the Immediate window, type:
?CustomizationContext
and press Enter.
What is displayed as the result?
If the result is NOT the template attached to the active document (if a
document is open) or the Normal template if no documents are open, you should
find where in your code you change the CustomizationContext. After that code,
insert e.g. the following to reset CustomizationContext to “neutral”:
'Reset CustomizationContext
If Documents.Count > 0 Then
CustomizationContext = ActiveDocument.AttachedTemplate
Else
CustomizationContext = NormalTemplate
End If
And insert that piece of code after each and every piece of code where the
CustomizationContext has been changed.
For more details, see:
http://msdn.microsoft.com/en-us/library/aa537165.aspx
--
Regards
Lene Fredborg - Microsoft MVP (Word)
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
Thanks
DeanH
I have included some questions below. You do not necessarily need to answer
the question but they may help you checking things.
As you can see from the article
http://msdn.microsoft.com/en-us/library/aa537165.aspx (link also included in
my previous post), customization conflicts may arise. Note especially point 4
below the heading “Conflicting Customizations”.
Normally, CustomizationContext would be the template attached to the active
document.
If the active document is based on External.dot and if it is still attached
to that template, the CustomizationContext is supposed to be External.dot.
Since it is not, it could be because a) your document is actually no longer
attached to External.dot (check in Tools > Templates and Add-Ins) or b)
because something (e.g. code in your External.dot or in another location such
as Normal.dot or an add-in) has changed the CustomizationContext.
In External.dot, did you add any custom menus to the Menu Bar? In that case,
the Adobe menus and your menu(s) may conflict.
When making customizations – via the user interface or via code – it is very
important to make sure that the customizations are saved in the correct
context. When making the customizations via the user interface, you must
always be very careful to select the appropriate template or document from
the “Save in”/”Save changes in” or “Make toolbar available to” list in the
Customization dialog box.
Do you have add-ins installed? In that case, did you install something new
around the time when the problem with the missing menus occurred?
Does your code in External.dot or in Normal.dot contain any AutoMacros, e.i.
AutoNew, AutoOpen, AutoExec, AutoClose? In that case, you should check
whether that code contains anything that changes the CustomizationContext.
Also note the explanation below the heading “A Word of Caution About
Design-Time Customizations” in the above mentioned article:
Quote: “For best results, it is important to create design-time
customizations on a non-customized instance of Word. That is, no add-ins
should be loaded and the default global template (Normal.dot) should be a
fresh copy generated by Word containing no modifications by the developer.”
This is especially important if you change the built-in Menu Bar or
toolbars. If you add all customizations to a custom toolbar, it is easier to
make sure that you don’t conflict with anything else and this also makes it
more unlikely that add-ins outside your control would make any harm to your
customizations.