Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.69 KB

Office.IRibbonControl.md

File metadata and controls

54 lines (36 loc) · 1.69 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
IRibbonControl object (Office)
vbaof11.chm288000
vbaof11.chm288000
Office.IRibbonControl
63aef709-e1d3-b1a6-76af-b568ad0e69ae
01/16/2019
medium

IRibbonControl object (Office)

Represents the object passed into the callback procedure of a control in a ribbon or another user interface that can be customized by using Office Fluent ribbon extensibility.

Remarks

The IRibbonControl object contains the name (ID) of the control and the current Window object for the Ribbon UI control.

Example

The following example, written in C#, shows two procedures called from the onAction event procedure of a Button control and a ToggleButton control.

In the first procedure, the IRibbonControl object representing the control is passed into the procedure, and a message box is displayed indicating that the button was pressed along with the ID of the button.

The second procedure is similar to the first with the addition of a Boolean parameter indicating that the button was pressed.

public void ButtonOnAction(IRibbonControl control) 
{ 
 MessageBox.Show("Button clicked: " + control.Id); 
} 
 
public void ToggleButtonOnAction(IRibbonControl control, bool pressed) 
{ 
...if (pressed) 
 MessageBox.Show("ToggleButton was switched on."); 
 else 
 MessageBox.Show("ToggleButton was switched off."); 
}

See also

[!includeSupport and feedback]