Temporary CommandBars

The Temporary parameter of the CommandBars.Add method and the CommandBarControls.Add method does not apply to Word.
The Temporary feature is intended for other applications that do not support session-specific settings.
Because Word can store information in global templates or local templates, you can get all of the Temporary functionality without actually using the Temporary flag.

If you're going to add CommandBar or CommandBarControl objects to Word at run-time, and you want them to be truly temporary, set the Application.CustomizationContext to something other than Normal.dot before you begin making your changes.
You should actually set this to point to your actual template instead.
Make sure you do not set the Temporary to True.


CustomizationContext Property

Returns or sets a Template or Document object that represents the template or document in which changes to menu bars, toolbars, and key bindings are stored.
Use the CustomizationContext property to set the template or document context prior to accessing the CommandBars collection.
Corresponds to the value of the Save in box on the Commands tab in the Customize dialog box (Tools menu).


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrev