Solved

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

Posted on 2001-06-14
5
480 Views
Last Modified: 2010-04-06
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.
0
Comment
Question by:tomcorcoran
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:RickHalle
ID: 6193241
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
0
 
LVL 2

Accepted Solution

by:
RickHalle earned 75 total points
ID: 6193983
0
 

Author Comment

by:tomcorcoran
ID: 6201302
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.
0
 

Author Comment

by:tomcorcoran
ID: 6201359
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.
0
 
LVL 2

Expert Comment

by:RickHalle
ID: 6201721
FWIW I couldn't get the Template to work in Delphi either.

Rick
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now