Add Method

[Microsoft Agent is deprecated as of Windows 7, and may be unavailable in subsequent versions of Windows.]

Description

Adds a Command object to the Commands collection.

Syntax

agent**.Characters ("CharacterID").Commands.Add** Name, Caption, Voice, Enabled, Visible

Part Description
Name Required. A string value corresponding to the ID you assign for the command.
Caption Optional. A string value corresponding to the name that will appear in the character's pop-up menu and in the Commands Window when the client application is input-active. For more information, see the Command object's Caption property.
Voice Optional. A string value corresponding to the words or phrase to be used by the speech engine for recognizing this command. For more information on formatting alternatives for the string, see the Command object's Voice property.
Enabled Optional. A Boolean value indicating whether the command is enabled. The default value is True. For more information, see the Command object's Enabled property.
Visible Optional. A Boolean value indicating whether the command is visible in the character's pop-up menu for the character when the client application is input-active. The default value is True. For more information, see the Command object's Visible property.

 

Remarks

The value of a Command object's Name property must be unique within its Commands collection. You must remove a Command before you can create a new Command with the same Name property setting. Attempting to create a Command with a Name property that already exists raises an error.

This method also returns a Command object. This enables you to declare an object and assign a Command to it when you call the Addmethod.

   Dim Cmd1 as IAgentCtlCommandEx
   Set Cmd1 = Genie.Commands.Add ("my first command", "Test", "Test", True, True)
   Cmd1.VoiceCaption = "this is a test"

Insert method

RemoveAll method

Remove method