Solved

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

Posted on 2001-06-14
5
496 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 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