WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE COM ADO CDO ADSI LDAP
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to include an Office Assistant


Question:

Sounds like a stretch, but I just thought I'd ask and see if anyone has as ever attempted to add and Office Assistant to a Winbatch program? I think that would be a very useful application specific help option. Any ideas? Someone here jokingly asked if I could add this to my program. I think that would be really neat, especially if we could use HOWIE the Winbatch Owl. Maybe we need a "Ask Howie" Extender.

Answer:

Here is some sample code that requires Micrsoft Agent, L&H TrueVoice, and the Merlin character. In order to use the sample code in this article, you need to install the Microsoft Agent core components.

Downloads:
http://www.microsoft.com/msagent/downloads/default.asp

http://www.microsoft.com/msagent/downloads/user.asp#character

Reference:
http://msdn.microsoft.com/library/en-us/msagent/agentstartpage_7gdh.asp?frame=true

http://msdn.microsoft.com/library/en-us/dnoxpta/html/odc_msagent-i.asp?frame=true

NOTES:
Microsoft Agent uses SAPI 4.0 to provide speech services. Windows XP however now ships with SAPI 5.0 which does not provide backward compatibility support for its predecessor. Fortunately, SAPI 4.0 and SAPI 5.0 can co-exist together on the same Windows XP computer.

In order for the speech engines to work with Microsoft Agent in Windows XP, the SAPI 4.0 runtime support is also required to be installed already.

;MICROSOFT SPEECH AGENT (PEEDY).WBT 
;********************************************************************************
; Microsoft Agent Example
;
; Requires Micrsoft Agent, L&H TrueVoice, and the Merlin character
; Available from http://www.microsoft.com/msagent/default.asp
;********************************************************************************

; Create an instance of the control 
MyAgent = ObjectOpen("Agent.Control.2")

MyAgent.Connected = @TRUE

Characters = MyAgent.Characters

; Load the character

Characters.Load("Peedy", "peedy.acs")

Peedy = Characters.Character("Peedy")


; Display the character      

Peedy.Show
Peedy.MoveTo(300,460)

Peedy.Speak("Hello all.")

Peedy.Speak("I am Peedy.")

;Note the use of single quotes so you can use double quotes in the map command
;The map command has 2 parameters.  The first is how you want the text pronounced.
;The second is how you want it shown in the balloon
Peedy.Speak('Using agent within \Map="Win Batch"="WinBatch"\ is not that difficult.')
Peedy.Speak('Since you are running an \Map="Oh Lay"="OLE"\ object,')
Peedy.Speak('In order to sync \Map="Win Batch"="WinBatch"\ commands with things happening in agent,')
Peedy.Speak("You loop until the 'status' of a command is complete.")
Peedy.think('Any idiot ought to know that!')
Peedy.MoveTo(620,460)
GestureRight = Peedy.Play("GestureRight")
While @TRUE
   If GestureRight.Status == 0 then break ;if gesture command has succesfully completed
EndWhile
Peedy.Think('Man, this machine is slooooow...')
Run("notepad","")
TimeDelay(3)
SendKey("This is a notepad example.{ENTER}")
Peedy.Play("RestPose")
Peedy.Speak("Now I'll close notepad, choosing not to save the file")
TimeDelay(5)
SendKey("!fx")
TimeDelay(1)
SendKey("n")

AgentDone = Peedy.Speak("Thus ends this agent example.")

While @true
   If AgentDone.Status == 0 
      TimeDelay(1)
      Peedy.Hide
      TimeDelay(3)
      Exit
   EndIf
   TimeDelay(1)
EndWhile

Article ID:   W16069
File Created: 2004:03:30:15:42:42
Last Updated: 2004:03:30:15:42:42