Close 方法

       

关闭活动的非模态气球。只有在回调过程中才能使用此方法。

expression.Close

expression   必需。该表达式返回一个 Balloon 对象。

示例

本示例可实现的功能为:显示这样一个气球,该气球包含三台打印机各自的按钮。无论何时,只要用户单击其中任何按钮,ProcessPrinter 回调进程即开始运行,而该气球关闭。

Sub selectPrinter()
Set bln = Assistant.NewBalloon
With bln
    .Heading = "Select a Printer."
    .Labels(1).Text = "Network Printer"
    .Labels(2).Text = "Local Printer"
    .Labels(3).Text = "Local Color Printer"
    .BalloonType = msoBalloonTypeButtons
    .Mode = msoModeModeless
    .Callback = "ProcessPrinter"
    .Show
End With
End Sub

Sub ProcessPrinter(bln As Balloon, lbtn As Long, _
 lPriv As Long)
    Assistant.Animation = msoAnimationPrinting
    Select Case lbtn
    Case -1
        ' Insert network printer-specific code.
    Case -2
        ' Insert local printer-specific code.
    Case -3
        ' Insert color printer-specific code.
    End Select
    bln.Close
End Sub