Solved

page orientation

Posted on 1998-06-05
5
158 Views
Last Modified: 2010-08-05
one:  how to set printer to portrait/landscape within Visual Basic version 3.0
two:  how to print top to bottom text instead of left to right
0
Comment
Question by:jcadams
  • 3
  • 2
5 Comments
 

Author Comment

by:jcadams
Comment Utility
Edited text of question
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
For question one:
Check out MSKB Question Q80185 at
http://support.microsoft.com/support/kb/articles/q80/1/85.asp

For question two:
I don't think you could do this.  Are you talking about printing Kanji?
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
By the way.  Asking two unrelated questions at one time is not fair.  You should have posted two separate questions.
0
 

Author Comment

by:jcadams
Comment Utility
Lousy answer
0
 
LVL 6

Accepted Solution

by:
clifABB earned 100 total points
Comment Utility
Lousy question.


Add the following code to the global module:
Type OrientStructure
      Orientation As Long
      Pad As String * 16
End Type
Const PORTRAIT = 1
Const LANDSCAPE = 2
Const GETSETPAPERORIENT = 30

' Enter the following Declare statement:
Declare Function Escape% Lib "GDI" (ByVal hDc%, ByVal nEsc%, ByVal nLen%, lpData As OrientStructure, lpOut As Any)

The following code will print in landscape:

Dim Orient As OrientStructure

Printer.Print ""

Orient.Orientation = LANDSCAPE

x% = Escape(Printer.hDC, GETSETPAPERORIENT, Len(Orient), Orient, NULL)
Printer.EndDoc

Printer.Print "Should print in landscape mode"
Printer.EndDoc

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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

762 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

6 Experts available now in Live!

Get 1:1 Help Now