Microsoft Agent Tutorial Chapter 2 (VB6, MSAgent 2)

Microsoft Agent Tutorial Chapter 2 (VB6, MSAgent 2) -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Microsoft Agent Tutorial Chapter 2 (VB6, MSAgent 2) http://abstractvb.com/code.asp?A=715 1 of 2 11/21/2006 11:54 PM Main > Code Central Microsoft Agent Tutorial Chapter 2 ID: 715 Author: Abstractvb Date: 4/22/2000 6:54:54 PM VB6, MSAgent 2 Part 1 - Adding Agent Commands To get the Agent to respond to userinput you will need to add commands. Commands are a word or series of words the Agent waits for. Once one of the commands is spoken the agent will call the Commands() Event and return the name of the command that was spoken. Name your Agent Control MSAgent. Add this to the Form_Load() Event: MSAgent.Characters.Load "DefaultCharacter" Set AgentChar= MsAgent.Characters("DefaultCharacter") AgentChar.Commands.Add "Notepad", "Notepad", "Notepad", True, True Private Sub MsAgent_Command(ByVal UserInput As Object) MsgBox UserInput.Name End Sub There, now try running it. Press SCROLLLOCK and then say your agents name to get him to appear. Once the agent has appeared press SCROLLLOCK again to get the agent to listen and then say the word "Notepad". A msgbox should appear with the word notepad in it, since that is the name we gave our command. The first parameter listed above is the name that is what the Command() Event will return to you when your command is spoken. The next is the Caption parameter, which will determine how this command is displayed in the Agent Voice Commands Window.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Microsoft Agent Tutorial Chapter 2 (VB6, MSAgent 2) -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online