Returns the Command corresponding to the specified index (0-based) or key.
// get accessor Command CommandCollection.get_Item( Object idx ); |
Parameter | Type | Description |
---|---|---|
Key | Long or String |
Index or name of the command to retrieve. Note: This method expects the true command name (see SIObject.Name), not the Command.ScriptingName. Note: Avoid using numerical indexes as they can change from computer to computer as users create custom commands. |
' Display information about a command SUB ShowCommand( ByRef oCommand ) logmessage "--------------------------------" logmessage "Name: " & oCommand.Name logmessage "FileName: " & oCommand.FileName logmessage "Handler: " & oCommand.Handler logmessage "Language: " & oCommand.language logmessage "Type: " & oCommand.type END SUB set oCommands = Application.Commands ' get the first command set oFoundCommand = oCommands.Item( 0 ) ShowCommand oFoundCommand ' find the same command using its name set oCommandByName = oCommands.Item( oFoundCommand.Name ) ShowCommand oCommandByName |