M
Mark Rubin
Hi,
If I create a new document based on a template with toolbars, and then
execute the following line of code, my toolbars disappear:
Application.CustomizationContext = Application.CustomizationContext
I've tried this with Word 97-2003. I simply opened a document, added
a custom toolbar, saved the document as a template, closed Word and
restarted it, created a new document based on my template (my toolbar
appears, as you'd expect), and then executed this line of code in VBA.
Originally this was found when I had code that cached the original
Application.CustomizationContext, loaded an addin, set the
CustomizationContext to my addin, and then tried to set the
Application.CustomizationContext back to its original value. So then
I simplified my coding logic and came up with this.
Does anyone know what's going on here? Perhaps I'm not understanding
the CustomizationContext too well, or global templates, or something
like that--I'm relatively green at Word automation. Still, it seems
odd to me that this code should have such a side-effect.
Thanks for any help.
-- Mark
If I create a new document based on a template with toolbars, and then
execute the following line of code, my toolbars disappear:
Application.CustomizationContext = Application.CustomizationContext
I've tried this with Word 97-2003. I simply opened a document, added
a custom toolbar, saved the document as a template, closed Word and
restarted it, created a new document based on my template (my toolbar
appears, as you'd expect), and then executed this line of code in VBA.
Originally this was found when I had code that cached the original
Application.CustomizationContext, loaded an addin, set the
CustomizationContext to my addin, and then tried to set the
Application.CustomizationContext back to its original value. So then
I simplified my coding logic and came up with this.
Does anyone know what's going on here? Perhaps I'm not understanding
the CustomizationContext too well, or global templates, or something
like that--I'm relatively green at Word automation. Still, it seems
odd to me that this code should have such a side-effect.
Thanks for any help.
-- Mark