programmatically controlling header/footer on doc printed from WebBrowser control 
Author Message
 programmatically controlling header/footer on doc printed from WebBrowser control

I am using the WebBrowser control in VB6.  I have the box loaded with
HTML and I want to print the thing off, but when I print it, I want to
set the header and footer that show up on each printed page.  In the
real IE, you can do this from the "Page Setup" screen, but how can I
do this programmatically with the WebBrowser control?  Any help would
be GREATLY appreciated!  Thanks in advance!

brad guilford



Sun, 12 Aug 2001 03:00:00 GMT  
 programmatically controlling header/footer on doc printed from WebBrowser control
You can display the Page Setup dialog with

    wbr.ExecWB _
        cmdid:=OLECMDID_PAGESETUP, _
        cmdexecopt:=OLECMDEXECOPT_PROMPTUSER

To set the header/Footer programatically, I know of no other way than
temporarily changing the Registry settings at

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup

with code that ensures that things are always restored, especially in event
of error.

If you do find a better way, I would like to hear about it.

Barry Evans
Canberra, Australia
----------------------------

I am using the WebBrowser control in VB6.  I have the box loaded with
HTML and I want to print the thing off, but when I print it, I want to
set the header and footer that show up on each printed page.  In the
real IE, you can do this from the "Page Setup" screen, but how can I
do this programmatically with the WebBrowser control?  Any help would
be GREATLY appreciated!  Thanks in advance!

brad guilford



Sun, 12 Aug 2001 03:00:00 GMT  
 programmatically controlling header/footer on doc printed from WebBrowser control
Hi Brad,

if you want to totally automate it, use Sendkey with Barry's tip:
You have control over the information you want to put there...

It's ugly, and locks up the machine like crazy if you call it in a tight
loop, but it's working fine as long as no one is interested in a "clean"
interface... <g>

HTH

Thomas

Barry Evans schrieb in Nachricht ...

Quote:
>You can display the Page Setup dialog with

>    wbr.ExecWB _
>        cmdid:=OLECMDID_PAGESETUP, _
>        cmdexecopt:=OLECMDEXECOPT_PROMPTUSER

>To set the header/Footer programatically, I know of no other way than
>temporarily changing the Registry settings at

>HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup

>with code that ensures that things are always restored, especially in event
>of error.

>If you do find a better way, I would like to hear about it.

>Barry Evans
>Canberra, Australia
>----------------------------


>I am using the WebBrowser control in VB6.  I have the box loaded with
>HTML and I want to print the thing off, but when I print it, I want to
>set the header and footer that show up on each printed page.  In the
>real IE, you can do this from the "Page Setup" screen, but how can I
>do this programmatically with the WebBrowser control?  Any help would
>be GREATLY appreciated!  Thanks in advance!

>brad guilford



Wed, 22 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to customize or suppress header and footer when printing from WebBrowser control

2. How to customize/suppress header and footer when printing from WebBrowser control

3. How to customize or suppress header and footer when printing from WebBrowser control

4. How to customize/suppress header and footer when printing from WebBrowser control

5. print the customise header and footer when using webbrowser

6. Printing webbrowser - removing header and footer programatically

7. Controlling the header and footer in the page setup of browser control when printing

8. WebBrowser Contro : Printing HTML documents ?

9. Headers&Footers: Custom Doc Property or Bookmark?

10. How to print web content without printing the headers and footers

11. Programmatically Print Contents of WebBrowser Control

12. Printing custom header/footer in Outlook

 

 
Powered by phpBB® Forum Software