Assistant Object

Description

Represents the Microsoft Office Assistant.

Using the Assistant Object

Use the Assistant property to return the Assistant object. There's no collection for the Assistant object; only one Assistant object can be active at a time. Use the Visible property to display the Assistant.

Remarks

The default Assistant is Clippit. To select a different Assistant programatically, use the FileName property.

The following example displays a previously selected Assistant and animates it with the associated sound. If your computer doesn't have a sound card installed, this example won't generate an error, but the sound won't be heard.

With Assistant
    .Visible = True
    .Sounds = True
    .Animation = msoAnimationBeginSpeaking
End With
Properties

Animation property, Application property, AssistWithAlerts property, AssistWithHelp property, AssistWithWizards property, BalloonError property, Creator property, FeatureTips property, FileName property, GuessHelp property, HighPriorityTips property, Item property (Assistant, BalloonLabel, and BalloonCheckbox objects), KeyboardShortcutTips property, Left property, MouseTips property, MoveWhenInTheWay property, Name property, NewBalloon property, Parent property, Reduced property, SearchWhenProgramming property, Sounds property, TipOfDay property, Top property, Visible property.

Methods

ActivateWizard method, EndWizard method, Help method, Move method, ResetTips method, StartWizard method.

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)