SUMMARY
Microsoft Office 97 introduces the Office Assistant, a cartoon-like
character designed to answer questions and help you perform routine tasks
with Microsoft Office applications. Office Assistants have an object model
available in the "Microsoft Office 8.0 Object Library" (Mso97.dll) and it
appears that the Assistant objects may be manipulated similar to any other
OLE object. However, attempting to manipulate the Assistants from Visual
Basic may cause the following error:
Run-time error '-2147467259 (80004005)':
Operation cannot be performed when the application is inactive
Other errors may occur as well. These errors usually indicate an invalid
use of a property or method, or a similar OLE automation error.
The Office Assistant object model is read-only when used outside of
Microsoft Office applications. Properties of the Office Assistant may be
read; for example, the following line of code returns true or false:
Msgbox Assistant.Visible
However, Office Assistant properties cannot be changed or set, and methods
may not be executed from within Visual Basic or any other development
environment without a reference to an active Office application object. For
example, executing the following line causes the error described above:
Assistant.Visible = True
To programmatically manipulate the Microsoft Office Assistants from within
Visual Basic, you must create a reference to an active Office application
object, such as "Access.Application," from which you can manipulate the
Assistant.
NOTE: In Office 2000 and later, the Office Assistants use MSAgent technology. The methods for automating assistants in Office 2000 differ from those described in this article.