Control Windows using Speech Recognition with MS Agent

Gabriel Medina

Version Compatibility: Visual Basic 6

More information:
This is a simple example of how MS Agent can be used to control your computer like for example, speaking at your mic "Excel" and have your Microsoft Excel application running, say "Okay" and have your default dialog box button accepted or "Cancel" and cancel the dialog box. you can also say "Time" and the Agent will tell you the time, on screen and also by speaking the time aloud to you using Text to Speech capabilities of MS Agent, also, program it to recognize words like "Name" or "Address" and have your complete name or address typed in immediately, say "CNN" or "News" and have Internet explorer open the CNN Homepage, you just hit [Scroll Lock] and give your command, you can really get used to this.

The file commands.txt must be in the app.path (It can be changed by code) This file contains rows comma-separated with 4 fields i.e.: Calc, Open Calculator, Calc, c:\windows\calc.exe Fields 1 and 3 are always the same, field 2 is a description of what the command does, and field 4 contains the path to the command you want performed.

This 4th field can be as follows: Command (i.e. Calc) for executables available in windows path. Path/Command.exe for executables not available in win. path. (for example to open a web page you would use something like C:\Program Files\Internet Explorer\IEXPLORE.EXE

Write to make the agent write something for you (Write Joe Dirt - This would type "Joe Dirt" for you) WriteLn is same as above but appends [ENTER] to the text string.

See the provided commands.txt for examples.

There are some built-in commands:

Close: Closes active window
Minimize: Minimizes active window
Okay: Equivalent to hitting the ENTER key
Cancel: Equivalent to hitting the ESC key
Time: Speaks the current time and shows it on screen
Bye: Closes the Assistant (This program)
Yes: Equivalent to hitting Alt+Y
No: Equivalent to hitting Alt+N
Next: It's supposed to move from the current active window onto the next window, but It's not working, any help, would be appreciated.
You need to install the MS Agent Components available for download at

You need to install vrgirl.exe also contained in the package, this little character is really cute and looks professional, thanks to the author.

Anyway, if you have trouble making it work, I'm available 9-to-5 MST in MSN or send me email to that same address.

This same text is available in the ZIP package in Readme.txt

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.