Solved

VBscript error with MS Agent Control

Posted on 2004-04-01
2
601 Views
Last Modified: 2008-01-09
Getting an error on line 11 of this program.  I have loaded the Agent software properly.  Thanks for any ideas.
'
' Popup message using Microsoft Agent
'
Set MSAgent = CreateObject("Agent.Control.2")
'
If IsObject(MSAgent) = False Then
   MsgBox "Microsoft Agent is not installed."
   Quit
End If
'
MSAgent.Characters.Load "merlin", "merlin.acs"   ' <--- getting error on this line
Set Merlin = MSAgent.Characters("merlin")
'
With Merlin
    .MoveTo 600,100
    .Show
    .Play("Read")
    .Speak("Your message is ready for you to read.")
End With
'
For z = 1 To 9
    While DateDiff("s", dl, Now) < 1
    Wend
Next
'
Merlin.Hide
'
Set MSAgent = Nothing
Set Merlin = Nothing
'
0
Comment
Question by:mistert006
2 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 10739000
What is the error ?
0
 
LVL 4

Accepted Solution

by:
sokolovsky earned 500 total points
ID: 10739159
Try this:
<OBJECT ID="AgentControl" width=0 height=0
 CLASSID="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
 CODEBASE="#VERSION=2,0,0,0">
</OBJECT>

<OBJECT ID="TruVoice" width=0 height=0
 CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
 CODEBASE="#VERSION=6,0,0,0">
</OBJECT>

<SCRIPT language=VBScript>
' In this example the Microsoft Agent control is managed using VBScript.
' Alternatively, JScript could be used.

Dim Robby      ' a global variable to hold the character object
Sub window_OnLoad
      AgentControl.Connected = True      ' necessary for IE3
      AgentControl.Characters.Load "Robby", "http://agent.microsoft.com/agent2/chars/robby/robby.acf"
      Set Robby = AgentControl.Characters("Robby")
      Robby.LanguageID = &H0409            ' needed under some conditions (English)
      Robby.Get "State", "Showing, Speaking"
      Robby.Get "Animation", "Greet, GreetReturn"
      Robby.Show
      Robby.Get "State", "Hiding"
      Robby.Play "Greet"
      Robby.Speak "Hello, World!"
      Robby.Hide
End Sub
</SCRIPT>

Change Robby to Merlin. Works FINE!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now