From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Set Page Setup when printing with Internet Explorer?

Hello,

I'm using the LabVIEW 7.1 Print HTML Report VIs.
However, I'd like to change the default margings and footer and headres of Microsoft internet explorer which is used to do the actual printing.

I tried to find a way using the functionality of IWebBrowser2 (Wich is actaully used by the original VIs). It seems I have to use OLECMDID_GETPRINTTEMPLATE and pass a structure of the type ITemplatePrinter.
How can this be done - or is there a more simple way to do this?

Thanx,
Rainer
0 Kudos
Message 1 of 7
(13,574 Views)
Good question. I'm using IE's print preview feature for our HTML reporting and it's great but there's a way to send a template htm file to printpreview and print by specifying a flattened string variant to pvaIn of ExecWB. I didn't get this to work. Did anyone else?
0 Kudos
Message 2 of 7
(13,390 Views)
I'm looking for the same features.  Ideally you would be able to send the page setup parameters to IE programatically but so far I've had no luck doing that or finding any reference on how it would be done.  The closest thing I've seen is the print templates, but I am still unsure how those would be implemented exactly.  I did find this reference for the template which seems fairly descriptive:

http://msdn2.microsoft.com/en-us/library/bb250434.aspx

Message Edited by Deej60 on 04-03-2007 06:17 PM

0 Kudos
Message 3 of 7
(13,350 Views)
have you tried the registry?
0 Kudos
Message 4 of 7
(13,333 Views)
You mean to edit the Page Setup default values registry settings for IE ?  I thought about that but didn't try it yet.
0 Kudos
Message 5 of 7
(13,326 Views)
Jackpot!

http://support.microsoft.com/kb/236777

Thanks for the tip.  Had you already found that article?
0 Kudos
Message 6 of 7
(13,319 Views)
No. However i knew this should be possible. (MS does love hidden registry settings). So i had to kinda dig around the registry myself (painful). But that's a great article, that'll allow me to show it to my boss so as to convince him that even the big brother does it and it is safe. Thanks!
0 Kudos
Message 7 of 7
(13,298 Views)