ActiveX Document

ActiveX Document (also known as DocObject or DocObj) is a Microsoft technology that allows users to view and edit Microsoft Word, Excel, and PDF documents inside web browsers. It defines a set of Component Object Model coding contracts between hosting programs like Internet Explorer or Microsoft Office Binder and hosted documents from programs like Microsoft Word, Microsoft Excel and Adobe Reader. This allows them to negotiate communications about commands like save and navigate, as well as merging user interface elements such as menu, to provide a unified user experience.

Initially designed for compound documents based on COM Structured Storage, the technology allows one single hosting program like Office Binder to contain unlimited type of documents. The server program that provides an ActiveX document can be an EXE or a DLL server.

Code contracts

There are a few code contracts that ActiveX documents and their container need to implement in order to communicate about their capabilities and requirements.

An ActiveX document server application needs to implement the following code contracts that are expected by an ActiveX document container that is going to host the document:

  • IPersistStorage, if use compound files as the storage
  • Standard OLE interfaces like IPersistFile, IOleObject, and IDataObject, for creating a document that supports object linking and embedding from file
  • IOleInPlaceObject and IOleInPlaceActiveObject, for editing inline
  • IOleDocument, IOleCommandTarget, and IPrint, for talking to document container, command routing, and printing

An ActiveX document container application needs to implement the following code contracts

  • Provide storage for documents via IStorage
  • Implement IOleClientSite and IAdviseSink, for standard object linking and embedding
  • Implement IOleInPlaceSite and IOleInPlaceFrame, for editing inline
  • Implement IOleDocumentSite, IOleCommandTarget, IPrint and IContinueCallback, for document hosting, command routing and printing

Developer Support

Microsoft has ActiveX Document support in its developer tools to help programmers in creating ActiveX Document applications.

In Visual C++, programmers can include Microsoft Foundation Classes's support for ActiveX Documents in the MFC project wizard. A programmer can choose to add ActiveX document server and/or container support to the new program by checking a checkbox during the project creation process.

In Visual Basic, ActiveX Document Migration wizard helps programmers to convert VB forms into ActiveX documents.

In Visual FoxPro, The ActiveDoc Base Class supports development for ActiveX document servers.

This page was last updated at 2023-08-02 16:52 UTC. Update now. View original page.

All our content comes from Wikipedia and under the Creative Commons Attribution-ShareAlike License.


If mathematical, chemical, physical and other formulas are not displayed correctly on this page, please useFirefox or Safari