Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft Agent
Message
From
05/11/2002 17:16:09
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00718355
Message ID:
00719084
Views:
14
>Anyone here knows how to create a confirmation form with Microsoft Agent...
>Till this moment I run functions like speak, play, think and others, but I couldn't run a confirmation form like the clip in the office...

Here's something from the "Working with Balloon Objects" topic in the Office XP Developer Help:

"The Assistant's Balloon object enables the Assistant to communicate with and get feedback from your users. Balloon objects are designed to make it possible for you create a simple interface for user interaction. They are not designed to replace complex dialog boxes.

Balloon objects can contain text that can be plain, underlined, or displayed in different colors. In addition, Balloon objects can contain labels or check boxes, certain icons, and bitmaps. Only one Balloon object can be visible at a time, but you can create multiple Balloon objects in code and use them when required.

You create a Balloon object by using the Assistant's NewBalloon property. When you have created the new Balloon object, you can set its properties and then display it by using the Balloon object's Show method. The following two simple procedures illustrate many of the features of Balloon objects discussed so far. The TestCreateSimpleBalloon procedure creates two formatted strings used to specify the balloon Heading and Text properties. The procedure then creates the balSimple Balloon object by calling the CreateSimpleBalloon procedure and passing in the heading and text strings. CreateSimpleBalloon sets several other "default" properties for this balloon and then returns the new Balloon object to the calling procedure where it is displayed by using the Show method.
Sub TestCreateSimpleBalloon()
   Dim balSimple          As Balloon
   Dim strMessage         As String
   Dim strHeading         As String
   Dim blnAssistVisible   As Boolean
   
   strHeading = "This is a simple balloon."
   strMessage = "When you have finished reading this message, click OK to proceed." _
      & vbCrLf & "{cf 249}This text is red." & vbCrLf & "{cf 252}This text is blue." _
      & vbCrLf & "{cf 0}This text has a {ul 1}word{ul 0} that is underlined." _
      & vbCrLf & "This text is plain."
   blnAssistVisible = Application.Assistant.Visible
   
   Set balSimple = CreateSimpleBalloon(strMessage, strHeading)
   
   If Not blnAssistVisible Then
      Call ShowAssistant
   End If
   With balSimple
      .Show
   End With
   Application.Assistant.Visible = blnAssistVisible
End Sub

Function CreateSimpleBalloon(strText As String, _
                             strHeading As String) As Office.Balloon

   Dim balBalloon As Balloon
   
   With Application.Assistant
      Set balBalloon = .NewBalloon
      With balBalloon
         .BalloonType = msoBalloonTypeButtons
         .Button = msoButtonSetOK
         .Heading = strHeading
         .Icon = msoIconTip
         .Mode = msoModeModal
         .Text = strText
      End With
      Set CreateSimpleBalloon = balBalloon
   End With
End Function
Note that the strMessage variable contains a string that includes embedded brackets such as {cf 252}, {cf 0}, {ul 1}, and {ul 0}. You use the {cf value} brackets to specify the color of the text that follows the bracket. You use the {ul value} brackets to specify where text underlining begins and ends. For more information about specifying text color and underlining text in Balloon objects, search the Microsoft® Office Visual Basic Reference Help index for "Text property."

If you run the sample code, you will notice that the code stops executing while the Balloon object is displayed. This is because the balloon's Mode property specifies that the balloon is modal. In addition, you can display modeless Balloon objects."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform