AddStrokeBinding Method (BindingTables Collection)

Object: BindingTables Collection

Adds a Stroke to the KeyBindings collection.

Usage

BindingTables.AddStrokeBinding (ByVal Stroke As String,
ByVal Command As String
ByVal BindType As Variant,
ByVal UserData As Variant) As IKeyBinding

Description

You can overwrite existing Stokes in the application. Refer to the Strokes topic in the application help for more information on Strokes.

Arguments

String

A string that Stroke pattern.

Command

A string that contains the menu command, script function, keyin command or key to assign to the Stroke.

BindType

A BindType constant that defines the command type—key press, menu command, script function, or keyin command.

UserData

(Optional) Reserved for future use.

Return Values

IKeyBinding. The new KeyBinding Object.

Examples

' Get the document BindingTables object  
Set docBindingTables = Gui.Bindings("Document") 
 
' Assign Stroke to the “2” key  
docBindingTables.AddStrokeBinding "14789", "2", BindKey  
 
' Assign Stroke to menu item “FitBoard”  
docBindingTables.AddStrokeBinding "159", "View->FitBoard", BindMenu  
 
' Assign Stroke to a script function  
Set bindObj = docBindingTables.AddStrokeBinding( "258", "" ,BindFunction)  
bindObj.Target = ScriptEngine  
bindObj.ExecuteMethod = "myLaunchDirMethod"  
 
' Assign Stroke to a keyin command  
docBindingTables.AddStrokeBinding "951", "run c:\temp\NewUserLayer.vbs",
					BindCommand