HOWTO: Use Automation to Set the Printer from an MFC Project (180312)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 5.0
- Microsoft Visual C++, 32-bit Editions 6.0
- Microsoft Word 97 for Windows
- Microsoft Excel 97 for Windows
- Microsoft Excel 2002
- Microsoft Word 2002
- Microsoft Word 2000
This article was previously published under Q180312 SUMMARY
This article discusses how to use version 4.2 of the Microsoft Foundation
Class (MFC) library installed with Microsoft Visual C++ versions 5.0 and
6.0 to automate specifying and setting the printer used with a project.
This article shows how to use the IDispatch interface of the _Application
object from the typelib of the application that you are automating. The
sample code specifically uses Microsoft Word, but the approach works with
any other application where the _Application IDispatch interface has the
appropriate member functions.
Alternatively, you can use the Windows API library functions to set the
printer directly; however, this article does not discuss this approach.
REFERENCESFor additional information about the Automation of Office applications, click the article number below
to view the article in the Microsoft Knowledge Base:
222101 HOWTO: Find and Use Office Object Model Documentation
Modification Type: | Minor | Last Reviewed: | 2/21/2005 |
---|
Keywords: | kbhowto KB180312 |
---|
|