UpdateMethod Property (CommandBarButton Object)

Object: CommandBarButton Object

Access: Read/Write

Sets or returns the method when to enable or disable the commandbar button.

Usage

CommandBarButton.UpdateMethod = String

Arguments

None.

Return Values

A string that represents the method when to enable or disable the commandbar button.

Examples

' 
' This example add a menu entry to execute a key-in command, "pr *" with a 
' user-defined update method to enable/disable the menu entry 
' 
' With the menu controls collection object (CommandBarControls) defined 
Set button = myMenuCtrls.Add 
button.Caption = "Place Unplaced Parts" 
button.OnAction = "pr *" 
button.Target = ScriptEngine 
button.UpdateMethod = "onUpdatePlaceUnplaced"    
' call update method below with this name 
 
Function onUpdatePlaceUnplaced(nID) 
     ' Disable the command if no unplaced parts 
     If doc.components(epcbSelectUnplaced).count > 0 Then 
         onUpdatePlaceUnplaced = true 
     Else 
         onUpdatePlaceUnplaced = false 
     End If 
End Function