De-Attach the commandbar's context from (I presume) normal.dot by including
following statements:
To investigate whether normal.dot hosts the commandbar, rename normal.dot to
normal.org and startup Word, if the commandbar isn't there, it's hosted by
normal.dot and use below lines to restore the "normal" situation.
CustomizationContext = NormalTemplate
Application.CommandBars("MyBar").Delete
NormalTemplate.Save
If that doesn't fix it, try this line somewhere in the code
MsgBox(Application.CommandBars("MyBar").Context)
or
Debug.Print Application.CommandBars("MyBar").Context)
Locate the template and de-attach the commandbar using similar lines as
above, but point the
CustomizationContext clause to the target template, like in below lines
Dim tmp As Template
Dim d As Document
Set d = Documents.Add("c:\templates\MyTemplate.dot")
Set tmp = d.AttachedTemplate
CustomizationContext = tmp
Application.CommandBars("MyBar").Delete
tmp.Save
Next time you go about building up the/a commandbar, be aware of the
template context yr addressing.
More info on CustomizationContext clause, see below URL (from http through
to .asp)
http://msdn.microsoft.com/library/d...tml/woproCustomizationContext1_HV05210405.asp
-------------------------------------
Krgrds,
Perry
System parameters:
POS: WinXP SP2
MSO: MSOffice 2003 SP2
DEV: VS8 (dotnet)