Article ID: 184502
Article Last Modified on 6/23/2005
Sub Simple_Balloon()
' Create the balloon object.
Set myballoon= Assistant.NewBalloon
With myballoon
.Heading = "My Balloon"
.Text = "Click OK to close the balloon"
.Show
End With
End Sub
Sub List_Balloon()
' Create the balloon object.
Set myballoon= Assistant.NewBalloon
With myballoon
.Heading = "List Balloon"
.Text = "Click OK to close the balloon."
' Text for the list items:
.Labels(1).Text = "Click Save on the File menu to save " _
& "the file."
.Labels(2).Text = "Click Print on the File menu to " _
& "print the file."
' Create a numbered list.
.BalloonType = msoBalloonTypeNumbers
' Display the balloon.
.Show
End With
End Sub
The Office Assistant displays a balloon with a number list.
Sub Balloon_Checkboxes()
' Create balloon object.
Set myballoon = Assistant.NewBalloon
With myballoon
.Heading = "Regional Sales Data"
.Text = "Select your region"
' Place OK and Cancel buttons at bottom of the balloon.
.Button = msoButtonSetOkCancel
For i = 1 To 3
.CheckBoxes(i).Text = "Region " & i
Next
' Display the balloon and assign it to x.
x = .Show
i = 0
Select Case x
Case -1 'You clicked OK.
' Loop through check boxes on the balloon.
For Each y In .CheckBoxes
i = i + 1
If y.Checked Then
MsgBox "region " & i
End If
Next
Case -2 ' You clicked Cancel.
MsgBox "You clicked Cancel."
End Select
End With
End Sub
Sub Balloon_Array()
Dim myBalloonArray(2) As Balloon
With Assistant
For i = 1 To 2
' Create a new balloon object.
Set myBalloonArray(i) = .NewBalloon
Next
End With
With myBalloonArray(1)
.Heading = "This is balloon #1."
.Text = "Click OK to close the balloon."
' Display the first balloon.
.Show
End With
With myBalloonArray(2)
.Heading = "This is balloon #2."
.Text = "Click OK to close the balloon."
' Display the second balloon.
.Show
End With
End Sub
Sub Balloon_Options()
' Create a new balloon object.
Set balloon1 = Assistant.NewBalloon
With balloon1
.Heading = "Options Balloon"
' Create buttons for the list items.
.BalloonType = msoBalloonTypeButtons
.Text = "Click an option or click OK to close the balloon."
' Set the text for list items.
.Labels(1).Text = "Save your file."
.Labels(2).Text = "Print your file."
' Mode must be msoModeModeless in order to use Callback
' property.
.Mode = msoModeModeless
' Call the "ProcessOption" macro when a balloon list item is
' clicked.
.Callback = "ProcessOption"
.Show
End With
End Sub
' Every procedure specified in the Callback property is
' passed three arguments: the balloon that activated the
' procedure, the return value of the button the user pressed,
' and an integer that uniquely identifies the balloon that
' called the procedure.
Sub ProcessOption(bln As Balloon, ibtn As Long, iPriv As Long)
' bln: the name of the balloon that activated the procedure
' ibtn: the number of the button clicked in the balloon
' iPriv: an integer that uniquely identifies the balloon
Assistant.Animation = msoAnimationGoodbye
Select Case ibtn
Case 1
' Insert your routine here.
bln.Close
bln.Text = "You chose the Save option."
bln.Show
Case 2
' Insert your routine here.
bln.Close
bln.Text = "You chose the Print option."
bln.Show
Case Else ' You clicked something other than a list item.
bln.Close
End Select
End Sub
179216 OFF98: How to Use the Microsoft Office Installer Program
Additional query words: XL98 OFF98
Keywords: kbhowto kbprogramming kbdtacode KB184502