Syntax

expression.Show

expression Required. A variable that represents a object.

Example

This example creates a balloon containing two balloon label choices for setting printer orientation: Portrait and Landscape. The example uses the return value from the Show method in a Select Case statement to determine which orientation the user has chosen.

Visual Basic for Applications
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 return value from the Show method in a Select Case statement to determine the button clicked by the user.

Visual Basic for Applications
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 msoBalloonButtonCancel ' User selected Cancel button. returnValue = MsgBox("Operation canceled.", _ vbOKOnly, "Printer Message") Case msoBalloonButtonYes ' User selected Yes button. returnValue = MsgBox("Printer set to " & _ "Landscape.", vbOKOnly, "Printer Message") Case msoBalloonButtonNo ' User selected No button. returnValue = MsgBox("Printer orientation not " & _ "reset.", vbOKOnly, "Printer Message") End Select

See also: