Link to home
Start Free TrialLog in
Avatar of boardtc
boardtcFlag for Ireland

asked on

C++Builder 5.01 : TCppWebBrowser: - printing no header & footer

I know this is the wromg group but there are no experts answering C++Builder question in the C++ forum.

I am using TCppWebBrowser o print a htnl document in C++Builder 5.01.

How can I stop the header (dopcument title and page #) and footers (filename abd date) being printed?

Thanks, Tom.
Avatar of RickHalle
RickHalle

Here's the documentation for it. I do not do C++ builder but I think these links are what you are looking for. I think they are used like this:

ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, pvaIn, NULL);

If pvaIn is a VARIANT of type VT_BSTR, pvaIn specifies the path to a custom print template.

IDM_PRINT Command ID:
http://msdn.microsoft.com/workshop/browser/mshtml/reference/constants/IDM_PRINT.asp

TEMPLATEPRINTER Element:
http://msdn.microsoft.com/workshop/browser/hosting/printpreview/reference/behaviors/TemplatePrinter.asp

Rick
ASKER CERTIFIED SOLUTION
Avatar of RickHalle
RickHalle

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boardtc

ASKER

Rick,

Thanks so much, I had little - I was using ExecWB to print. I am not so sure how to deal with the IDM_PRINT commands and templates and if I can access is from C++Builder. SHDocVw.dll is wrapped which is how I can access ExecWB, but I am not sure about the rest.

From the article
http://support.microsoft.com/support/kb/articles/q236/7/77.asp
I can access the registry to temporarily alter the header Page infromation and the footer date. Perfect. That just leaves the additional footer filename info, I'm trying to figure how to get at that.

Thanks so much, Tom.
Avatar of boardtc

ASKER

Rich,

What can I say, superb :-) Temporarily altering the registry setting for footer and header wiped everything including the html title in the header and file name in the footer. Which is exactly what I wanted in a few lines of code. Thanks again, you have really helped me out.

Cheers, Tom.
FWIW I couldn't get the Template to work in Delphi either.

Rick