Agents Code in Word

S

Stacy

Hello. I am creating a word index of all my agents.

(I am using word because that's the only way I know to get to the Visual
Basic editor)


There is something (s) fundamentally wrong with this code but I can't
figure out what it is:
Here it is:


Private Sub Form_Load()
On Error Resume Next

Set AgentControl = CreateObject("Agent.Control.2")
AgentControl.Connected = True

Dim FSO As FileSystemObject: Set FSO =
CreateObject("Scripting.FileSystemObject")
Dim FOL, FILE: Set FOL = FSO.GetFolder("c:\Windows\msagent\chars").Files
Dim CharacterName As String
For Each FILE In FOL
CharacterName = Left(FILE.Path, Len(FILE.Path) - 4)
AgentControl.Characters.Load CharacterName, CharacterName & ".acs"
AgentControl.Characters.Character(CharacterName).MoveTo 0, 150
AgentControl.Characters.Character(CharacterName).Show
AgentControl.Characters.Character(CharacterName).Play ("Wave")
AgentControl.Characters.Character(CharacterName).Speak "My name is"
& CharacterName
For iCount = 1 To 300000000: Next iCount

Next
End Sub

What it should do
a) Have the first agent come up
b) He waves
c) He says his name
d) Then he stands there waving
e) The next character comes up little below the first
f) Waves and says his name
g) Now there are 2 characters waving.
h) On to the next character
i) At the end all the characters should be standing there waving. (I
tried to make them go ACROSS the page or in neat rows and columns all waving
with their name displayed, but I couldn't figure how to do that, so now the
characters just go down the page.)

2) What it does now:
a) After a loooooong time delay
b) The first agent comes up
c) He waves
d) He spells..yes spells...the full path of his name instead of
reading just his name.
e) Then the next character comes up on top of the first character
and repeats the process.

f) All the characters come up on top of each other
g) Then they all disappear!!

Any ideas on this one??

Thanks!

Stacy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top