Before customizing the menu and toolbar system, you must set the context in which the changes will be saved. This is done by setting the CustomizationContext property of the Application object to a Template or Document object.
For example, the line:
CustomizationContext = NormalTemplate
sets the customization context to the Normal template so that all changes will be saved in this template. The line:
CustomizationContext = ActiveDocument.AttachedTemplate
sets the customization context to the attached template of the active document.