Opens the Print Preview window for the current document using either the default print preview template or a custom template.

C++ Information

Command group CGID_MSHTML (defined in mshtmhst.h)
Symbolic constant IDM_PRINTPREVIEW
User interface Yes. Set nCmdExecOpt to OLECMDEXECOPT_PROMPTUSER.
IOleCommandTarget::Exec parameters
pvaInVARIANT of type VT_BSTR that specifies the path to a custom template. May be set to NULL to use the Windows Internet Explorer default print template.
pvaOut Set to NULL.
Header file mshtmcid.h
Applies to IHTMLDocument2::execCommand, IHTMLDocument2::queryCommandEnabled, IHTMLDocument2::queryCommandIndeterm, IHTMLDocument2::queryCommandState, IHTMLDocument2::queryCommandSupported, IHTMLDocument2::queryCommandValue, IOleCommandTarget::Exec, IOleCommandTarget::QueryStatus.


If no template path is supplied, MSHTML will use the default print preview template.

Minimum Availability

Internet Explorer 5.5 and later.

See Also

IDM_PRINT, LayoutRect, DeviceRect, TemplatePrinter, HeaderFooter, dialogArguments, Beyond Print Preview: Print Customization for Internet Explorer 5.5, Print Preview 2: The Continuing Adventures of Internet Explorer 5.5 Print Customization