print method

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
8 out of 16 rated this helpful - Rate this topic

Prints the document associated with the window.

Syntax

var retval = window.print();

Parameters

This method has no parameters.

Return value

Type: HRESULT

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

Standards information

There are no standards that apply here.

Remarks

Calling the print method has the same effect as choosing Print from the File menu. The 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 onbeforeprint event fires.
  2. The document prints.
  3. The onafterprint event fires.

The onbeforeprint and onafterprint events are particularly useful when not all the information on the document is visible at all times. Use the 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 onafterprint event.

See also

window

 

 

Send comments about this topic to Microsoft

Build date: 11/21/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

© 2013 Microsoft. All rights reserved.