Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing function for Microsoft Internet Control?

Status
Not open for further replies.

gabster

Programmer
Oct 23, 2001
192
US
Hi all...

I have an Microsoft Internet Control in a form, and now I would like to add a button that wil print my page.
What's the best way to do this?

Thanks,
Gabi.
 
to print:

WebBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPT


to print preview:
WebBrowser1.ExecWB OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER
 
Thanks a lot...

The print preview works great. However on the print button I get and "variable not defined" error on:

OLECMDEXECOPT_DONTPROMPT

Thanks a lot again,
Gabi.
 
A quick look at MSDN gives:

OLECMDEXECOPT_DODEFAULT = 0,

OLECMDEXECOPT_PROMPTUSER = 1,

OLECMDEXECOPT_DONTPROMPTUSER = 2,

OLECMDEXECOPT_SHOWHELP = 3


So use these enums.

For stuff like this, just copy and paste the constant name into Google and do a search, then pick out the MSDN ref.

It's much quicker than raising a forum query, and it resolves odd typos. Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Sorry, forgot to include the constant definitions

thanks johnwm for the constants and i couldnt agree with you more about Google, top search engine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top