Solved

IE6 and "PageSetup/orientation" reg key??

Posted on 2002-06-19
9
884 Views
Last Modified: 2012-08-13
Hi,

I have been trying lately to print reports using the HTMLDocument interface. I was forced to feed my HTMLDocument into a hidden IWebBrowser control to print without a print properties dialog.

To cut a long story short, I now need to print landscape. Easy, just set the "PageSetup/orientation" registery key to 2. Except... it seems that IE6.0 is broken, (no sorry its a "feature":) and it does not use the "orientation" key. In fact, if you print landscape in explorer, then quit and reload, it has forgotten the setting.

So, does anybody know how I can do this? I need to force the WebBrowser control to print landscape without any popup dialogs or anything ( its a background print )? Works fine on IE5.5 (cos of PageSetup/orientation).  It doesn't help setting the printer drvier to landscape directly usng a OpenPrinter/SetPrinter kind of call set, IE still does its own thing?

Many thanks in advance,
Mark
0
Comment
Question by:mh2
  • 5
  • 2
  • 2
9 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7092659
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7092975
i have something...
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7093204
Got it:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20166977

This is an exapmle on how to switch print background images/not print. The idea is the same, the values to change are:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup]
"orientation"="1"
"paper_size"="9"
"paper_source"="7"
"duplex"="2"
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 3

Author Comment

by:mh2
ID: 7095014
I am aware of the "orientation" key. Thing is, this turns it into landscape mode ( "orientation = 2" ) for IE5.5. IE 6 ignores this setting, and only prints landscape if you go through the page setup dialog in that session.

So, are you saying that the combination of key you gave above will actually force IE6 to also remember landscape mode without needing to got through a page setup dialog?

I'll try them out, have to wait for access to a machine with ie 6 on however. The major problem is that M$ doesn't seem to like selling NT4 licenses anymore, so it will have to eventually run on XP systems, and XP won't let you install IE5.5!!
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7095269
I have used the code of the link I gave you with IE6 and everything is going as it should be.
0
 
LVL 3

Author Comment

by:mh2
ID: 7095308
Which code? The page ( which I have actually been though before! ), covers alot of print wrokarounds and various things?

I tried the CBT hooking on the Print Properties dialog, but couldn't get it to work?

Or are u refering the the DEVMODE setting bit? I tried something like that before, just on my normal machine, but IE just ignored it (IE 5.5). It did work tho, cos all my other normal printouts all started coming out landscape!

Maybe you could tell me which technique u've used?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7095328
At the top of the page, there is a link for code sample.

Download http://msdn.microsoft.com/library/en-us/dnsamples/wb_print05.exe (which is explained in the "Changing Printer Defaults" section).
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7128867
Any progress?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 150 total points
ID: 7297440
This question appears to be abandoned. A question regarding it will be left in the CleanUp
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 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