Article ID: 167842
Article Last Modified on 1/19/2007
175066 ACC97: Microsoft Access 97 Sample Forms Available in Download Center
Option Explicit
Sub OpenBalloon()
Dim offBalloon As Office.Balloon
Set offBalloon = Application.Assistant.NewBalloon
With offBalloon
' Show the Office Assistant.
.Parent.Visible = True
' Set the heading and text of the balloon.
.Heading = "Welcome to the Microsoft Office 97 Assistant!"
.Text = "Click one or more of the check boxes below, and " _
& "also click either a label or a button."
' Make the balloon modeless.
.Mode = msoModeModeless
' Display the Back, Next, and Close Buttons.
' To determine the constants for other buttons you can place
' on a balloon, view the Microsoft Office 8.0 Object library
' in the Object Browser.
.Button = msoButtonSetBackNextClose
' Display two check boxes.
.Checkboxes(1).Text = "Checkbox 1"
.Checkboxes(2).Text = "Checkbox 2"
' Display two labels.
.Labels(1).Text = "Label 1"
.Labels(2).Text = "Label 2"
' Define which Callback procedure to run.
.Callback = "WhichButton"
.Show
End With
End Sub
Sub WhichButton(bln As Balloon, iBtn As Long, iPriv As Long)
Dim cBox As Office.BalloonCheckbox
bln.Close
For Each cBox In bln.Checkboxes
If cBox.Checked Then
MsgBox "Selected " & cBox.Item
End If
Next
Select Case iBtn
Case 1
MsgBox "Clicked Label 1"
Case 2
MsgBox "Clicked Label 2"
Case msoBalloonButtonBack
MsgBox "Clicked Back Button"
Case msoBalloonButtonClose
MsgBox "Clicked Close Button"
Case msoBalloonButtonNext
MsgBox "Clicked Next Button"
End Select
End Sub
OpenBalloon
Additional query words: asst
Keywords: kbhowto kbprogramming KB167842