DoPrint

 

Description

 

Paginates and prints all or part of the current HTML page, optionally presenting the user with a Print dialog.

 

Arguments

 

Name

Type

I/O

Description

bShowPrinterDialog

Boolean

In

Determines whether a Print dialog is displayed to allow the user to select printing parameters or cancel the print.

FromPage

Long Integer

In

The 1-based index of the first page to print or zero.

ToPage

Long Integer

In

The 1-based index of the last page to print or zero.

 

Return Value

 

Long Integer: a status value which may be one of:

 

>0

(positive value)

Success. The value is the number of pages printed.

-1

PRINTERR_BAD_DC

The DC passed in was Null or bad.

-2

PRINTERR_BAD_PAGERECT

The PageRect specified had a top left corner that was less than (0, 0) or was specified with values that would yield an empty page, for example(50, 50, 500, 50).

-3

PRINTERR_BAD_HTMLPAGE

No HTML page loaded (internal error).

-4

PRINTERR_BAD_PAGENUM

The page number passed to PrintToDC was less than 0 or greater than the maximum number of pages returned by a previous call to the Paginate2 method.

-5

PRINTERR_BAD_PAGETABLE

There was no page table entry for the page number specified (internal error).

-6

PRINTERR_BAD_PRINTER

The printer specified does not support bitmap graphics.

 

Remarks

 

When FromPage and ToPage are both zero, the whole document is printed.

 

Use the Paginate2 method if you need to determine the maximum number of printable pages generated from this HTML page.