This example creates a balloon containing two BalloonLabel choices for setting printer orientation: Portrait and Landscape. The example uses the Show method in a Select Case statement to determine which orientation the user has chosen.
Set balNew = Assistant.NewBalloon
With balNew
.Heading = "Please choose a printer orientation"
.Labels(1).Text = "Portrait"
.Labels(2).Text = "Landscape"
.Button = msoButtonSetNone
End With
Select Case balNew.Show
Case 1
' Insert code to set printer to portrait.
Case 2
' Insert code to set printer to landscape.
End Select
This example creates a balloon containing three command buttons: Yes, No, and Cancel. The example uses the Show method in a Select Case statement to determine the return value of the button clicked by the user.
Set balNew = Assistant.NewBalloon
With balNew
.Heading = "Are you sure you want to set the " & _
"printer orientation to landscape?"
.BalloonType = msoBalloonTypeButtons
.Button = msoButtonSetYesNoCancel
End With
Select Case balNew.Show
Case -2
returnValue = MsgBox("Operation canceled.", _
vbOKOnly, "Printer Message")
Case -3
returnValue = MsgBox("Printer set to " & _
"landscape.", vbOKOnly, "Printer Message")
Case -4
returnValue = MsgBox("Printer orientation not " & _
"reset.", vbOKOnly, "Printer Message")
End Select