Share via


RibbonMenu.Items Property (2007 System)

Gets the collection of controls that are on the menu.

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

Syntax

'Declaration
Public ReadOnly Property Items As RibbonComponentCollection(Of RibbonControl)
'Usage
Dim instance As RibbonMenu 
Dim value As RibbonComponentCollection(Of RibbonControl)

value = instance.Items
public RibbonComponentCollection<RibbonControl> Items { get; }
public:
property RibbonComponentCollection<RibbonControl^>^ Items {
    RibbonComponentCollection<RibbonControl^>^ get ();
}
public function get Items () : RibbonComponentCollection<RibbonControl>

Property Value

Type: Microsoft.Office.Tools.Ribbon.RibbonComponentCollection<RibbonControl>
The collection of controls that are on the menu.

Exceptions

Exception Condition
InvalidOperationException

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

Remarks

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 Tools for Office automatically adds the controls to the Items property of the menu.

.NET Framework Security

See Also

Reference

RibbonMenu Class

RibbonMenu Members

Microsoft.Office.Tools.Ribbon Namespace

Other Resources

Ribbon Object Model Overview