Solved

page orientation

Posted on 1998-06-05
5
161 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
ID: 1462653
Edited text of question
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1462654
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
ID: 1462655
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
ID: 1462656
Lousy answer
0
 
LVL 6

Accepted Solution

by:
clifABB earned 100 total points
ID: 1462657
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 48
How to measure sizes and angles in scanned images ? 3 76
Passing a Text Box name to a Sub 6 99
transition to visual .net from vb6 5 37
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…
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…

860 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