Prints an object on the specified printer, using the specified job requirements.
HRESULT Print(
DWORD grfFlags, //Printing options
DVTARGETDEVICE **pptd,
//Address of output variable that receives a
//pointer to the TARGETDEVICE structure
PAGESET **pppageset, //Address of output variable that receives a
//pointer to the PAGESET structure
STGMEDIUM *pstgmOptions, //Pointer to object-specific printing
//options
IContinueCallback *pcallback,
//Pointer to callback interface
LONG nFirstPage, //Number of first page to be printed
LONG *pcPagesPrinted, //Pointer to total number of pages printed
LONG *pnLastPage //Pointer to number of last page printed
);
This method supports the standarde return value E_UNEXPECTED, as well as the following:
The printer on which the object is to be printed is indicated by the DVTARGETDEVICE structure pointed to by pptd. The DEVMODE structure in the target device indicates whole-job printer-specific options, such as number of copies, paper size, and print quality. The DEVMODE structure may also contain orientation information in the dmOrientation field (this is indicated in the dmFields field). If present, then this paper orientation should be used; if absent, then natural orientation as determined by the object content is to be used.
Due to the possibility of user input, the parameters pptd and ppPageSet are both [in,out] structures. In the absence of user interaction (that is, if the PRINTFLAG_PROMPTUSER flag is not set), both the target device and the page set will necessarily be the same for input and output. However, if the user is prompted for print options, then the object returns target device and page-set information appropriate to what the user has actually chosen.
The ppstgmOptions parameter is also [in,out]. On exit, the object should write to *ppstgmOptions any object-specific information that it would need to reproduce this exact print job. Examples might include whether the user selected "sheet, notes, or both" in a spreadsheet application. The data passed is in the format of a serialized property set. The data is normally useful only when passed back in a subsequent call to the same object. Because a subsequent call may specify different user interaction flags, target device, or other settings, the caller can cause the document to be printed multiple times in the same way in slightly different printing contexts.
Windows NT: Use version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in docobj.h.
‹
TBD ›