Solved

IE6 and "PageSetup/orientation" reg key??

Posted on 2002-06-19
9
872 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 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
i have something...
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
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
 
LVL 3

Author Comment

by:mh2
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
Any progress?
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 150 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

744 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

12 Experts available now in Live!

Get 1:1 Help Now