ACC: How to Use In-Place Activation with OLE Objects

ID: Q112748


The information in this article applies to:


SUMMARY

Moderate: Requires basic macro, coding, and interoperability skills.

Microsoft Access supports in-place activation of OLE objects in a form's Form view. In a form or report's Design view, or in a table, query, or form's Datasheet view, activation of an OLE object will cause the object's original application to run in the background as a server application (if the original application is available), so you can edit the object in Microsoft Access.


MORE INFORMATION

In-place activation of an OLE object allows you to edit or otherwise manipulate the object without switching to the object's original application. For example, you could edit an embedded document that was created in Microsoft Word for Windows without having to start Word for Windows.

When you edit an OLE object in place, the object's border becomes a hatched frame and the menus and menu options supported by the object's original application are added to the standard Microsoft Access menus. Toolbars supported by the object's original application may also be displayed.

The object's original application runs in the background and supplies the functionality it supports for the object, but the application is not visible and does not appear in the Windows Task Bar.

For an OLE object to be activated in place, the following must be true:

If the Locked property is set to Yes, you will be able to edit the object, but will not be able to save the changes and will receive the following message when attempting to save:

   Microsoft Access can't save your changes to this bound OLE object
   because you don't have permission to write to the record in which the
   object is stored or the record is locked by another user. 

If the object is linked, you can activate it in place, but you cannot edit it in place.

The AutoActivate property controls how an object is activated. The default value is Double-Click, which allows you to double-click the object to activate it. If you set the property to Manual, you have to select the object, choose <object type> from the Edit menu, and then choose the first verb listed to activate it. Setting AutoActivate to GetFocus (available only in unbound object frames) forces activation of the object when it receives focus on the form.

The following is an example of how to create an OLE object that supports in-place activation:
  1. Start Microsoft Access and either create or open any database.


  2. Create a new form.


  3. Using the Unbound Object Frame tool, create a new frame on the form.


  4. In the Object Type box, select a server that supports OLE 2.0. For this example, choose Microsoft Graph 5.0, and then click OK.


  5. On the Microsoft Graph File menu, click Exit & Return To Form: <Formname>.


  6. In Microsoft Access, set the frame's Enabled property to Yes and its Locked property to No.


  7. View the form in Form view.


  8. Double-click the embedded graph. The graph's border will change to a hatched frame, and several menus and menu options will change. If no Graph 5.0 toolbars are displayed, click Toolbars on the View menu and select one of the toolbar check boxes.


  9. Click anywhere in the form outside of the OLE object to deactivate the graph.



REFERENCES

For more information about in-place activation, search the Help Index for "in-place," or ask the Microsoft Access 97 Office Assistant.

For more information about whether or not a specific object application supports in-place activation, refer to that application's documentation.

Additional query words: interoperability ole embedding


Keywords          : IntpOle 
Version           : 2.0 7.0 97
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: April 3, 1999