Tuesday, July 26, 2005

Coding the Office Assistant to appear - or not


Andrew posted this interesting piece of code on his website a while ago. I have been contemplating using it for some clients who need prompting through their data entry processes.
If the office assistnat keeps popping up in your applications then it was you!
Sub Speak()
With Assistant
.Visible = True
.On = True
End With
With Assistant.NewBalloon
.Text = "Yes Sire?"
.Show
End With
End Sub

Sub GoAway()
With Application.Assistant
.AssistWithAlerts = True
Select Case _
.DoAlert("", _
"Do you want me to go away?", _
msoAlertButtonYesNo, _
msoAlertIconNoIcon, _
msoAlertDefaultFirst, _
msoAlertCancelSecond,False)
Case vbYes
With Assistant
.On = False
.AssistWithAlerts = False
End With
End Select
End With
End Sub

Go to his website to view the screenshots.