-
Hey everybody,
Does anyone know how to declare an instance of MS Agent just code? I don't want to use the MS agent control if I don't have to I've looked on Microsoft's site for answers to this one, and couldn't find anything helpful to me.
Thanks in advance for your help!
-
As dictated by Karl Moore:
1] Create a new Visual Basic project
2] Click 'Project', 'References'
3] Find and select 'Microsoft Agent Control 2.0'
4] Create the following public variables in the 'General Declarations' section behind your Form:
Code:
Dim WithEvents CoreAgent As Agent
Dim Assistant As IAgentCtlCharacterEx
5] Add a Command Button to Form1
6] Change it's Caption to "Initialise Agent"
7] Insert the following code behind the Command Button:
Code:
Set CoreAgent = New Agent
CoreAgent.Characters.Load "Assistant"
Set Assistant = CoreAgent.Characters("Assistant")
The only way to access MSAgent is through the control. You can either add it to the references of your project or add the MSAgent component to your components list. I believe this is the better way to do it as you do not need a form to use the agent.
-
Thanks for the help! I think I'll see if I can add this to a wrapper class now so I don't need a form at all :)