[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Microsoft Assistant

Posted on 2005-03-10
11
Medium Priority
?
387 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
  • 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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month7 days, 16 hours left to enroll

607 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