Compartir a través de


RibbonBase.OfficeMenu Property

Definition

Gets a RibbonOfficeMenu that represents the Microsoft Office Menu customization.

public:
 property Microsoft::Office::Tools::Ribbon::RibbonOfficeMenu ^ OfficeMenu { Microsoft::Office::Tools::Ribbon::RibbonOfficeMenu ^ get(); };
public Microsoft.Office.Tools.Ribbon.RibbonOfficeMenu OfficeMenu { get; }
member this.OfficeMenu : Microsoft.Office.Tools.Ribbon.RibbonOfficeMenu
Public ReadOnly Property OfficeMenu As RibbonOfficeMenu

Property Value

A RibbonOfficeMenu that represents the Microsoft Office Menu customization.

Examples

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

Note

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.

Dim numControlsInOfficeMenu As Integer = Me.OfficeMenu.Items.Count  
int numControlsInOfficeMenu = this.OfficeMenu.Items.Count;  

Remarks

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.

Applies to