Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: onafterprint Event Fires Before the Print Dialog Box Appears


View products that this article applies to.

This article was previously published under Q272765

↑ Back to the top


Symptoms

In Internet Explorer 5.5, the onafterprint event fires before the Print dialog box appears. In earlier versions of Internet Explorer, onafterprint fired after the Print dialog box appeared and only if the user chose to print the document from the dialog box. If the user chose to cancel this dialog box, the event would not fire.

↑ Back to the top


Cause

The onafterprint event does not indicate whether printing occurred; instead, onafterprint is designed to allow changes that are made in the onbeforeprint event to be modified after the markup.

↑ Back to the top


Resolution

You cannot determine from a script whether the document actually printed.

↑ Back to the top


More information

The onbeforeprint and onafterprint events are attached neither to the Print dialog box (where onbeforeprint fired after this) nor the printing (where onafterprint fires before this). They bracket the point at which a "snapshot" is taken of the markup for printing, and this behavior has not changed from Internet Explorer 5.0 to Internet Explorer 5.5.

The sequence in which the onafterprint event fires in relation to the Print dialog box may change in future versions of Internet Explorer to synchronize with the Print dialog box.

↑ Back to the top


References

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

↑ Back to the top


Keywords: KB272765, kbprint, kbprb

↑ Back to the top

Article Info
Article ID : 272765
Revision : 3
Created on : 5/11/2006
Published on : 5/11/2006
Exists online : False
Views : 408