Solved

IE6 and "PageSetup/orientation" reg key??

Posted on 2002-06-19
9
891 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
[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
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Industry Leaders: 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

710 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