Udostępnij za pośrednictwem


OfficeRibbon.OfficeMenu Property (2007 System)

Gets a RibbonOfficeMenu that represents the Microsoft Office Menu customization.

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 OfficeMenu As RibbonOfficeMenu
'Usage
Dim instance As OfficeRibbon 
Dim value As RibbonOfficeMenu 

value = instance.OfficeMenu
public RibbonOfficeMenu OfficeMenu { get; }
public:
property RibbonOfficeMenu^ OfficeMenu {
    RibbonOfficeMenu^ get ();
}
public function get OfficeMenu () : RibbonOfficeMenu

Property Value

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

Remarks

The Microsoft Office Menu is the menu that opens when you click the Microsoft Office Button. You can add controls to the Microsoft Office Menu only by using the Ribbon Designer. For more information, see How to: Customize the Microsoft Office Menu.

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 OfficeMenu instance that is exposed by the RibbonOfficeMenu property.

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 a Visual Studio Tools for 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;

.NET Framework Security

See Also

Reference

OfficeRibbon Class

OfficeRibbon Members

Microsoft.Office.Tools.Ribbon Namespace