print method

[This documentation is preliminary and is subject to change.]

Prints the document associated with the window.


HRESULT retVal = object.print();

Standards information

There are no standards that apply here.


This method has no parameters.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


Calling the IHTMLWindow3::print method has the same effect as choosing Print from the File menu. The IHTMLWindow3::print method activates the Print dialog box, prompting the user to change print settings. When the user clicks the OK button, the following sequence of events occurs:

  1. The HTMLWindowEvents::onbeforeprint event fires.
  2. The document prints.
  3. The HTMLWindowEvents::onafterprint event fires.

The HTMLWindowEvents::onbeforeprint and HTMLWindowEvents::onafterprint events are particularly useful when not all the information on the document is visible at all times. Use the HTMLWindowEvents::onbeforeprint to modify the document to make all the information on the page visible for printing. To return the document to its original state, use the HTMLWindowEvents::onafterprint event.



Build date: 6/12/2012

Community Additions