BalloonType Property
Applies To
Balloon object.
Description
Returns or sets the type of balloon the Office Assistant uses. Can be one of the following MsoBalloonType constants: msoBalloonTypeButtons, msoBalloonTypeBullets, or msoBalloonTypeNumbers. When you create a new balloon with the NewBalloon method, this property is initially set to msoBalloonTypeButtons. Read/write Long.
See Also
Balloon object, BalloonError property.
Example
This example creates an instruction balloon that explains how to select a printer. The balloon is modeless, so the user can follow the instructions in the balloon and keep the balloon visible as he or she works.
Set bln = Assistant.NewBalloon
With bln
.Heading = "Instructions for Choosing a Printer."
.Text = "Click OK when you've chosen a printer."
.Labels(1).Text = "From the File menu, choose Print."
.Labels(2).Text = "Click Setup."
.Labels(3).Text = "Select the name of the printer."
.BalloonType = msoBalloonTypeNumbers
.Mode = msoModeModeless
.Callback = "ProcessPrinter"
.Button = msoButtonSetOK
.Show
End With
Example (Microsoft Access)
The following function creates a custom balloon for the Office Assistant and determines how the user responded to the balloon:
Function AssistantBalloon(Optional varCheck As Variant, Optional _
varLabel As Variant)
Dim bch As BalloonCheckbox
Dim intI As Integer
Dim intReturn As Integer
Dim strCheck(5) As String
Dim strList As String
' Create new balloon.
Set bal = Assistant.NewBalloon
' Specify balloon type.
bal.BalloonType = msoBalloonTypeButtons
' Specify that balloon is modal.
bal.Mode = msoModeModal
' Make Assistant visible.
If Assistant.Visible = False Then Assistant.Visible = True
' Check if first argument has been passed.
If Not IsMissing(varCheck) Then
' If too large, set to maximum number of check boxes (5).
If varCheck > 6 Then
varCheck = 5
End If
' Set text property to alphabet character.
For intI = 1 To varCheck
bal.Checkboxes(intI).Text = Chr(64 + intI)
Next intI
End If
If Not IsMissing(varLabel) Then
' If too large, set to maximum number of labels (5).
If varLabel > 6 Then
varLabel = 5
End If
For intI = 1 To varLabel
' Set text property to alphabet character.
bal.Labels(intI).Text = Chr(64 + intI)
Next intI
End If
' Store return value.
intReturn = bal.Show
intI = 0
' Determine which check boxes were checked, if any.
For Each bch In bal.Checkboxes
If bch.Checked = True Then
strCheck(intI) = bch.Text
strList = strList & "'" & strCheck(intI) & "'" & Chr(32)
End If
intI = intI + 1
Next
If Len(strList) <> 0 Then
MsgBox "You selected checkboxes " & strList & "."
End If
' Determine which label was selected, if any.
If intReturn > 0 Then
MsgBox "You selected label " & bal.Labels(intReturn).Text & "."
End If
End Function
You could call this function from the Debug window as follows:
? AssistantBalloon(4, 5)