Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Microsoft Assistant

Posted on 2005-03-10
11
Medium Priority
?
386 Views
Last Modified: 2010-05-19
How do I add the microsoft assistant to my program? I would also like to have it do the following:

have a subroutine (called whatever you want) with "strsay as String and yesno as Boolean" for the inputs when I call the subroutine.

what this does is it makes the assistant say strsay, and be a normal OK box if yesno is False, or a Yes box and a No box if yesno is True.

Also I would like to be able to have him pop up with a simple call of a subroutine

Is this possible?
0
Comment
Question by:cachedVB
[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
  • 6
  • 3
  • 2
11 Comments
 
LVL 12

Expert Comment

by:gbzhhu
ID: 13507187
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 13507310
Make sure that Microsoft Agent 2.o is installed
Add the Agent just like normal controls via the components dialog and place the agent on your form

To get started

    Dim m As New AgentObjects.Agent

    m.Characters(1).Show
    m.Characters(1).Speak "Hello"

There are several characters to choose from.  I don't have the Agent installed here at work but I have lots of good agent code at home should someone not give you a fully working code

0
 
LVL 9

Expert Comment

by:Dang123
ID: 13509176
cachedVB,
    These may help
Dang123


Microsoft Agent Tutorial
http://www.freevbcode.com/ShowCode.Asp?ID=2082

Microsoft Agent Tutorial Chapter 1
http://abstractvb.com/code/code714.asp

Microsoft Agent Tutorial Chapter 2
http://abstractvb.com/code.asp?A=715

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:cachedVB
ID: 13509984
Can you please upload the project somewhere and post the link here?  Please include the functions I asked for as I tried most of those and failed at doing so.
0
 
LVL 12

Accepted Solution

by:
gbzhhu earned 2000 total points
ID: 13533577
if your are coding with VBA here is what you need

Private Sub Test()
    Call AgentSay("Hello World", False)
End Sub

Public Sub AgentSay(StrSay As String, YesNo As Boolean)
    Dim bln As Balloon
   
    Set bln = Application.Assistant.NewBalloon
   
    With bln
        .Heading = "Whatever heading."
        .Text = StrSay
        .BalloonType = msoBalloonTypeButtons
        If YesNo Then
            .Button = msoButtonSetYesNo
        Else
            .Button = msoButtonSetOK
        End If
        .Mode = msoModeModal
        .Show
    End With
End Sub

If you are in VB then i am unable to set the Agent buttons (I am not sure it is possible) so I ignore the second parameter yesno

Private Sub Command1_Click()
    Call AgentSay("Hello World", False)
End Sub

Public Sub AgentSay(StrSay As String, YesNo As Boolean)
    Dim Merlin As IAgentCtlCharacterEx

    MSAgent.Characters.Load ("Merlin")
    Set Merlin = MSAgent.Characters("Merlin")
    Merlin.Show
    Merlin.Speak StrSay
End Sub
0
 
LVL 9

Expert Comment

by:Dang123
ID: 13534448
cachedVB,
    From VB6 (or VB5) check this sample

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=10573&lngWId=1

Dang123
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 13534785
Dang123

Does the code in the URL show balloon with buttons?  that is the only thing I couldn't do at the VB end.  It seems to be extra functionality for the Office assistant which is not available for the normal Agent

0
 
LVL 4

Author Comment

by:cachedVB
ID: 13586648
Is this topic dead?
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 13590078
cachedVB

You need to check if the code provided at the URL given by Dang123 has buttons on the balloon.  Then make comment on what is acceptable/not acceptable to you
0
 
LVL 4

Author Comment

by:cachedVB
ID: 13590604
It doesn't work for me at all... and from looking at the image posted over there it doesnt seem to work with Yes No buttons. Now another question (which may get rid of the last one): What is VBA and how do I use it (ie. Is that the thing that comes with word? If it is then it's perfect)
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 13591266
Yes, VBA comes with all Office apps including word

If you open a Word document then press ALT F11 (or go to the menu Tools-->Macro-->VisualBasic Editor)
Then enter tyhe code I provided above and see what you get
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Suggested Courses

722 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