WebBrowser header/footer

  • Thread starter Thread starter Peter Morris [Capable Objects]
  • Start date Start date
P

Peter Morris [Capable Objects]

Hi all

How can I remove the header/footer on the printout I get when I do
WebBrowser.Print?

I've got a product demo first thing in the morning, and it would look much
better without it!


Thanks

Pete
 
Pete,

You should be able to call the ExecWB method on the IWebBrowser2
interface for the web browser (you will have to get the result of the
ActiveXInstance property and cast to this interface, which you will need to
set a COM reference to shdocvw.dll, or define the interface yourself in
code).

From there, you will want to pass the IDM_TEMPLATE_PAGESETUP command
identifier, setting up the page to not print headers (see the documentation
for the command identifier for information on how to do that). Then, you
would pass the IDM_Print command identifier to execute the printing.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Peter Morris [Capable Objects]" <firstname + '.' +
(e-mail address removed)> wrote in message
news:[email protected]...
 
Hi Nicholas

Thanks for your quick reply. I'm finding it hard to find a webpage with an
example of this on, would you happen to know one?

Also, will this also allow me to adjust the margins? My data is being cut
off at the right margin of the page, and if I make the text any smaller it
wont be possible to read it :-)




Thanks

Pete
 
Peter,

I don't have an example offhand. Are you looking for .NET samples, or
are you looking for any sample which you can translate into .NET?

As for the margins, I don't think you can adjust those, at least not
from what I can see through the IDM_TEMPLATE_PAGESETUP command id.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Peter Morris [Capable Objects]" <firstname + '.' +
(e-mail address removed)> wrote in message
news:[email protected]...
 
Hi Nicholas

For now I have gone for the "Hack the registry" approach. One day I will
pay someone to convert some Delphi source code I have that does it
"properly" :-)


Thanks for your help!

Pete
 
Nicholas,

Do you still have any of the webbrowser control code for .Net?

I am writing a kid's webbrowser and can use all of the tweaks and help that
I can get.

Thanks!

jim


Nicholas Paldino said:
Peter,

I don't have an example offhand. Are you looking for .NET samples, or
are you looking for any sample which you can translate into .NET?

As for the margins, I don't think you can adjust those, at least not
from what I can see through the IDM_TEMPLATE_PAGESETUP command id.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Peter Morris [Capable Objects]" <firstname + '.' +
(e-mail address removed)> wrote in message
Hi Nicholas

Thanks for your quick reply. I'm finding it hard to find a webpage with
an example of this on, would you happen to know one?

Also, will this also allow me to adjust the margins? My data is being
cut off at the right margin of the page, and if I make the text any
smaller it wont be possible to read it :-)




Thanks

Pete
 
Back
Top