Microsoft KB Archive/180152

= How To Print from an Active Document Server =

Article ID: 180152

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q180152



SUMMARY
This article explains how to print from an Active Document (DocObject) server while the server is in-place activated in an Active Document container.



MORE INFORMATION
An Active Document server provides a mechanism for viewing the contents of a document within a single container, such as Microsoft Internet Explorer or Microsoft Office Binder. Active documents are displayed in the entire client area of the container, are involved in menu merging, and are always in-place active.

Microsoft Visual C++ provides an AppWizard that can help you create an Active Document server implemented using the Microsoft Foundation Classes (MFC).

When an Active document is in-place activated, a user may want to print the contents of the document using the Print menu item available on the container File menu. To provide this functionality in an MFC Active document server, perform the following steps:

  Declare an OLE command map in the declaration file for your COleServerDoc-derived class as follows: class CMyOleServerDoc : public COleServerDoc {        ...      protected: DECLARE_OLECMD_MAP };                         Implement the OLE command map in the implementation file for your COleServerDoc-derived class as follows: BEGIN_OLECMD_MAP(CMyOleServerDoc, COleServerDoc) ON_OLECMD_PRINT   // Implements OLE printing END_OLECMD_MAP 

