Printing HTML with mshtml and setting PageOrientation for DefaultPrinter
in registry
I'm using WebBrowser control to preview my HTML document which have to be
printed in landscape orientation.
For printing that document I use following code:
Dim htmldoc As mshtml.IHTMLDocument2 =
CType(WebBrowser1.Document.DomDocument, mshtml.IHTMLDocument2)
htmldoc.execCommand("Print", False, vbNull)
1)
Since second argument (showUI) is False (what is also default) I expect
that document will go to print without popup dialog and prompting user to
press Print button. But that on't happened. Dialog pops in any case. How
to get rid of that dialog and get printing without it by using mshtml.
2)
Second problem is that I cannot find registry key for setting
PageOrientation for default printer. In "Software\Microsoft\Internet
Explorer\PageSetup" is no that key present at all.
Where in registry to find a key for setting page orientation for default
printer which I can temporarily change for my print job?
No comments:
Post a Comment