使用 Assistant 属性可以返回对 Assistant 对象的引用。Assistant 为只读对象。
expression 必需。返回“应用于”列表中的一个对象的表达式。
以下示例使用 Application 对象的 Assistant 属性来操纵 Assistant 对象的各种属性和方法。
Public Sub AnimateAssistant()
Dim blnState As Boolean
With Assistant
' Save Assistant's visible state.
blnState = .Visible
' Make Assistant visible.
If blnState = False Then .Visible = True
' Animate Assistant.
.Animation = msoAnimationAppear
' Display Assistant object's Item and FileName properties.
MsgBox "Hello, my name is " & .Item & ". I live in " & _
.FileName, , "Assistant Information:"
' Return Assistant's visible state to original setting.
.Visible = blnState
End With
End Sub