
Print a Range from WebBrowser control
Does anyone know how to get the Microsoft WebBrowser control to print
a range of pages when using a Microsoft Word document.
I have a Word document loaded into the WebBrowser control, the
document has 3 pages, I just want to print pages 1 & 2.
The code I have tried so far is -
WebBrowser1.Document.PrintOut Range:=wdPrintRangeOfPages,
Item:=wdPrintDocumentContent, Copies:=1, Pages:="1-2",
PageType:=wdPrintAllPages, Collate:=True, Background:=True,
PrintToFile:=False
The above gets accepted as far as the syntax is concerned, but the
WebBrowser control ignores it and prints out the whole document.
I have also tried printing with the following
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, "",
""
Regards
Mike Bredbury