ExecuteMethod Property (CommandBarButton Object)

Object: CommandBarButton Object

Access: Read/Write

Sets or returns the procedure associated with the commandbar button.

Usage

CommandBarButton.ExecuteMethod = String

Arguments

None.

Return Values

A string that represents the procedure to be run when the button is clicked.

Examples

' 
' This example add a menu entry to execute a method defined in the script 
' 
' With the menu controls collection 
Set button = myMenuCtrls.Add 
button.Caption = "Zoom Selected" 
button.Target = ScriptEngine 
button.ExecuteMethod = "myZoomSelectedMethod" 
' call function below with this name 
button.DescriptionText = "Zoom around selected objects" 
 
Sub myZoomSelectedMethod( ) 
     ' zoom around selected objects 
     doc.ActiveViewEx.SetExtentsToSelection 
End Sub