Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

IE6 and "PageSetup/orientation" reg key??

Posted on 2002-06-19
9
Medium Priority
?
917 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 450 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Suggested Courses

824 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