Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

HOW TO: Animate the Office Assistant in Access 2000


View products that this article applies to.

This article was previously published under Q198461

↑ Back to the top


Summary

At times, you may want to animate the movements of the Office Assistant in response to actions performed in your application. For example, you may want to have the Assistant appear when you open a particular form. Or you may want the Assistant to react when a certain event is triggered. This article shows you how to do so.

NOTE: A demonstration of the techniques used in this article can be seen in the sample file, FrmSmp00.exe. For information about how to obtain this sample file, please see the following article in the Microsoft Knowledge Base:
233324� Microsoft Access 2000 Sample Forms Database Available in Download Center
The following example creates three event procedures that control the behavior of the Clippit Assistant. The first procedure selects Clippit and makes the Assistant visible when the Employees form is opened. The second procedure instructs Clippit to simulate listening to the computer when a field is updated. The third procedure closes the Assistant when the form is closed and resets some of the properties of the Assistant.

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

NOTE: This example assumes you have the Clippit Assistant (Clippit.acs) installed on your computer. By default the Assistants are installed in the C:\Program Files\Microsoft Office\Office folder.

Starting the Assistant

  1. Open the sample database Northwind.mdb.
  2. Open the Employees form in Design view.
  3. Set the OnOpen property of the form to the following event procedure.

    NOTE: The following sample code requires that you have a reference to the Microsoft Office 9.0 Object Library in your database. To create the reference, open any module in Design view, click References on the Tools menu, and then click the Microsoft Office 9.0 Object Library.
    Private Sub Form_Open(Cancel As Integer)
       With Assistant
          .Filename = "Clippit.acs"   ' Returns or sets the name of the
                                      ' active Office Assistant.
          .Visible = True
          .Animation = msoAnimationGreeting   ' Simulates greeting user.
          .Sounds = True
          .SearchWhenProgramming = True
          .FeatureTips = True
       End With
    End Sub
    					
  4. On the File menu, click "Close and Return to Microsoft Access."

Changing the Movement of the Assistant

  1. Set the AfterUpdate property of the FirstName text box to the following event procedure:
    Private Sub FirstName_AfterUpdate()
       With Assistant
          .Animation = msoAnimationListensToComputer  ' Animates
                                                      ' Assistant.
       End With
    End Sub
    					
  2. On the File menu, click "Close and Return to Microsoft Access."

Closing the Assistant When the Form Closes

  1. Set the OnClose property of the form to the following event procedure:
    Private Sub Form_Close()
       If Assistant.Visible = True Then
          With Assistant
             .AssistWithHelp = False
             .SearchWhenProgramming = False
             .GuessHelp = False
             .FeatureTips = False
             .Visible = False
          End With
       End If
    End Sub
    					
  2. On the File menu, click "Close and Return to Microsoft Access."
  3. Save the form, and then open it in Form view. Note that the Clippit Assistant is displayed.
  4. Type a new name in the First Name field and press ENTER. Note that the Clippit Assistant responds with "listening" animation.
  5. Close the form. Note that the Clippit Assistant closes.




↑ Back to the top


References

For more information about using the Office Assistant, click Microsoft Access Help on the Help menu, type Assistant in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

To see a list of file names that correspond to the different Office Assistants, from the Visual Basic Editor, click Microsoft Visual Basic on the Help menu, type "Filename property" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.






↑ Back to the top


Keywords: KB198461, kbhowtomaster, kbhowto

↑ Back to the top

Article Info
Article ID : 198461
Revision : 2
Created on : 7/15/2004
Published on : 7/15/2004
Exists online : False
Views : 393