DocumentBase.CreateRibbonObjects Method
Returns an array of OfficeRibbon objects to the CreateRibbonExtensibilityObject method.
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
This method is called by the default implementation of the CreateRibbonExtensibilityObject method when the project contains Ribbon (Visual Designer) items.
You can also override the CreateRibbonExtensibilityObject method to specify which Ribbons to display at run time. For more information, see Ribbon Overview.
The following code example overrides the CreateRibbonObjects method in the ThisDocument class and returns an array of two OfficeRibbon objects. The example requires that you add two Ribbons to your project called Ribbon1 and Ribbon2 by using the Ribbon (Visual Designer) item. To use this example, run it from the ThisDocument class in a document-level project.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.