Skip to main content

officeMenu Element

The officeMenu element specifies the Office Menu of the application. It is used to reference the built-in Office Menu. This element SHOULD NOT be specified if the containing Custom UI XML document is a Quick Access Toolbar Customizations part.

The officeMenu element is only available in Office 2007 Custom UI Part and stored in customUI.xml.

Root Namespace:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">

XML markup

The officeMenu Element uses the following XML markup:

<officeMenu>
	<!-- your ribbon controls here -->
</officeMenu>

Parent Elements

Children Elements

The Built-in Office Menu Elements

ELEMENT TYPE IDMSO APPLIES TO
New button FileMenu Excel/Access/Word
Print splitButton FilePrintMenu Excel/Word/Access
Publish menu MenuPublish Excel/Word/Access
Save button FileSave Excel/Word/Access
Close button FileClose Excel/Word
Open button FileOpen Excel/Word
Prepare menu FilePrepareMenu Excel/Word
Save As splitButton FileSaveAsMenu Excel/Word
Send menu FileSendMenu Excel/Word
Close Database button FileCloseDatabase Access
E-mail button FileSendAsAttachment Access
Manage menu FileManageMenu Access
Open button FileOpenDatabase Access
Save As splitButton FileSaveAsMenuAccess Access

Creating Custom officeMenu Controls

The following example creates a custom office menu and opens it with Excel 2021. The custom office menu is visible in the Excel 2021 Add-ins menu.

XML

Copy and paste the following XML code into Office 2007 Custom UI Part (stored in customUI.xml). If you don't know how to do it, read this article: Creating a Custom Ribbon.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
	<ribbon startFromScratch="false">
		<officeMenu>
			<splitButton id="sbtn"
			             insertBeforeMso="FilePrintMenu">
				<button id="btnSplitMain"
				        label="My Tools"
				        imageMso="CreateModule"/>
				<menu id="mnu"
				      itemSize="large">
					<menuSeparator id="sep1"
					               title="My Toolset 1"/>
					<button id="btnEmailDoc"
					        imageMso="FileSendAsAttachment"
					        label="E-mail selected table as attachment"
					        description="E-mail the selected table as an attachment to an e-mail recipient..."
					        onAction="shared_click"/>
					<button id="btnEmailSupport"
					        imageMso="MessageToAttendeesMenu"
					        label="E-mail technical support"
					        description="E-mail technical support about issues on this application..."
					        onAction="shared_click"/>
					<button id="btnEmailBug"
					        imageMso="ResearchPane"
					        label="E-mail a bug"
					        description="E-mail technical support about bugs found on this application..."
					        onAction="shared_click"/>
					<menuSeparator id="sep2"
					               title="My Toolset 2"/>
					<button id="btnPrintPDF"
					        imageMso="PrintDialogAccess"
					        label="Print to PDF"
					        description="Print active report to PDF file format"
					        onAction="shared_click"/>
				</menu>
			</splitButton>
		</officeMenu>
	</ribbon>
</customUI>

Download Custom officeMenu Demo

Download officeMenu Element Demo.

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>