Solved

VBscript error with MS Agent Control

Posted on 2004-04-01
2
619 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

691 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