RibbonOfficeMenu.Items Property
Gets the Ribbon controls that you added to the Microsoft Office Menu.
Namespace: Microsoft.Office.Tools.Ribbon
Assembly: Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
ReadOnly Property Items As IList(Of RibbonControl)
[BrowsableAttribute(false)]
IList<RibbonControl> Items { get; }
Property Value
Type: System.Collections.Generic.IList<RibbonControl>
The collection of Ribbon controls that you added to the Microsoft Office Menu at design time or run time.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | You try to add, remove, or replace a RibbonControl after the Ribbon is loaded. |
Remarks
You can add controls at run time, but only before the Ribbon is loaded. Create an instance of the control, and then add the new control to the Items collection. For more information, see Ribbon Object Model Overview.
When you add controls to the Microsoft Office Menu by using the Ribbon Designer, Visual Studio automatically adds the controls to the Items property.
.NET Framework Security
- 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.
See Also
Reference
Microsoft.Office.Tools.Ribbon Namespace