Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RibbonBase.OfficeMenu Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a RibbonOfficeMenu that represents the Microsoft Office Menu customization.

Namespace:  Microsoft.Office.Tools.Ribbon
Assembly:  Microsoft.Office.Tools.Common.v4.0.Utilities (in Microsoft.Office.Tools.Common.v4.0.Utilities.dll)
public RibbonOfficeMenu OfficeMenu { get; }

Property Value

Type: Microsoft.Office.Tools.Ribbon.RibbonOfficeMenu
A RibbonOfficeMenu that represents the Microsoft Office Menu customization.

The Microsoft Office Menu is the menu that opens when you click the File tab (for Microsoft Office 2010) or the Microsoft Office Button (for the 2007 Microsoft Office system). You can add controls to the Microsoft Office Menu only by using the Ribbon Designer. For more information, see How to: Add Controls to the Backstage View.

You can access a read-only collection of Ribbon controls in the Microsoft Office Menu customization at run time by using the Items property of the RibbonOfficeMenu instance that is exposed by the OfficeMenu property.

The following example gets the number of custom controls in the Microsoft Office Menu customization.

NoteNote

To run this code example, you must first add a Ribbon (Visual Designer) to an Office project. You can then run this code in the generated Ribbon class.

int numControlsInOfficeMenu = this.OfficeMenu.Items.Count;
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.