Export (0) Print
Expand All

RibbonMenu.Items Property

Gets the collection of controls that are on the menu.

Namespace:  Microsoft.Office.Tools.Ribbon
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

IList<RibbonControl> Items { get; }

Property Value

Type: System.Collections.Generic.IList<RibbonControl>
The collection of controls that are on the menu.

ExceptionCondition
InvalidOperationException

You try to add, remove, or replace a RibbonControl to this collection after the Ribbon is loaded.

To add a Ribbon control to a menu at run time, create an instance of the control, and then add the new control to the Items collection. If you want to do this after the Ribbon is loaded into the Office application, you must set the Dynamic property to true. For more information, see Ribbon Object Model Overview.

When you add controls to a menu by using the Ribbon Designer, Visual Studio automatically adds the controls to the Items property of the menu.

Show:
© 2015 Microsoft