OnAction Property (CommandBarButton Object)

Object: CommandBarButton Object

Access: Read/Write

Sets or returns the action to be taken when the commandbar button is clicked.

Usage

CommandBarButton.OnAction = String

Arguments

None.

Return Values

A string that represents the action to be taken when the commandbar button is clicked.

Description

This property is used for creating a new menu entry or toolbar button associated with a PCB application built-in command, or key-in command.

Examples

' 
' This example adds a menu entry using built-in command, Highlight 
' 
' With the menu object (CommandBar) defined 
Set cntrls = menu.Controls 
Set button = cntrls.Add 
button.Caption = "&Highlight" 
button.OnAction = "32867"      ' 32867 is the ID of the built-in command, Highlight