Solved

VBscript error with MS Agent Control

Posted on 2004-04-01
2
606 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

17 Experts available now in Live!

Get 1:1 Help Now