Results 1 to 3 of 3

Thread: [RESOLVED] Office Assistant - MSAgent?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    66

    Resolved [RESOLVED] Office Assistant - MSAgent?

    Hello
    I would like to create an office assistant within my VB program but I'm not quite sure where to start. I have read up about MsAgent but it doesnt clearly say what to do. I have added the MS Agent component and put one on my form but thats it so far! Any guidance will be appreciated!

    Thanks
    Amy

  2. #2
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Office Assistant - MSAgent?

    Hi,

    I attached a vb project about MS Agent control.

    I believe this will be useful to you and will clarify your doubts on that.
    Attached Files Attached Files
    CS

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    66

    Re: Office Assistant - MSAgent?

    OK i have managed to get some code working within a separate project but it doesnt run when i use it within my existing project. If i paste it into a new project and add the msagent controls it works fine but if i run it on a form within my current project it gives me the error "Invalid use of 'New' keyword". I have read lots of help files on this but cant seem to work it out. Can anybody help? Thanks in advance

    Here is my code:

    VB Code:
    1. Option Explicit
    2.  
    3. Private WithEvents MsAgent As Agent
    4.      Private peedy As IAgentCtlCharacterEx
    5.    
    6.      Private WithEvents MsAgent1 As Agent
    7.       Private merlin As IAgentCtlCharacterEx
    8.      
    9.  
    10.      Private Sub Form_Load()
    11.      
    12.      Dim peedyRequest As IAgentCtlRequest
    13.       Dim merlinRequest As IAgentCtlRequest
    14.      
    15.      'Create an Instance of the Agent Control
    16.      Set MsAgent = New Agent
    17.     Set MsAgent1 = New Agent
    18.      'Load the peedy Character
    19.      MsAgent.Characters.Load "peedy",
    20.  
    21. "c:\windows\msagent\chars\peedy.acs"
    22.      MsAgent1.Characters.Load "merlin",
    23.  
    24. "c:\windows\msagent\chars\merlin.acs"
    25.      Set peedy = MsAgent.Characters("peedy")
    26.     Set merlin = MsAgent1.Characters("merlin")
    27.      'Move the Character to the left
    28.      peedy.Left = 500
    29.     peedy.Top = 200
    30.     merlin.Left = 200
    31.     merlin.Top = 200
    32.      'Show peedy without playing the animation
    33. '     merlin.Show True
    34.     Set merlinRequest = merlin.Show
    35.  
    36.      peedy.Wait merlinRequest
    37.      
    38. '     peedy.Show True
    39.     Set peedyRequest = peedy.Show
    40.      merlin.Wait peedyRequest
    41.      
    42.      merlin.Play "announce"
    43.      peedy.Play "Write"
    44.      
    45.    Set merlinRequest = merlin.Speak("Hello Peedy. How are you?")
    46.      'Use bookmarks in the text to identify where peedy is
    47.  peedy.Wait merlinRequest
    48.  
    49.      Set peedyRequest = peedy.Speak("Hi Merlin. I'm fine thanks")
    50.  'peedy.Speak ("\Mrk=1\I am now reading line number one. " & _
    51.   '                "\Mrk=2\Now I am reading line two. " & _
    52.    '               "\Mrk=3\And finally, I am reading line three.
    53.  
    54. \Mrk=4\ ")
    55.    
    56.    merlin.Wait peedyRequest
    57.    Set merlinRequest = merlin.Speak("I think charley-anne got all
    58.  
    59. her questions right!")
    60.    
    61.    peedy.Wait merlinRequest
    62.    peedy.Play "pleased"
    63.    peedy.Play "congratulate"
    64.  
    65.    merlin.Play "congratulate"
    66.    
    67.    
    68.    
    69.      End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width