Solved

IE6 and "PageSetup/orientation" reg key??

Posted on 2002-06-19
9
888 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
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!

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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

761 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