Solved

VB6 Syntax - Printout in landscape mode

Posted on 2008-10-02
2
237 Views
Last Modified: 2010-04-21
Hi Experts

Just a quick syntax help on code i've adapted from PAQ (re landscape mode) . OrientStructure gives me  - "user defined type not defined"

Dim q As Integer
Dim Orient As OrientStructure
Const PORTRAIT = 1
Const LANDSCAPE = 2
Const GETSETPAPERORIENT = 30

    ''* Start the printer
    Printer.Print ""
    '* Specify the orientation
    Orient.Orientation = LANDSCAPE
   '*Printout contents of listbox
    For q = 0 To PATPrintLog.ListCount
       
            Printer.Print PATPrintLog.List(q)
            Orient.Orientation = LANDSCAPE
    Next q
       
    Printer.EndDoc
0
Comment
Question by:peterdarazs
2 Comments
 
LVL 15

Accepted Solution

by:
ChloesDad earned 250 total points
Comment Utility
Hi,

you should be able to do

    Printer.Orientation = vbPRORLandscape

' use vbPRORPortrait to set it as protrait
0
 

Author Closing Comment

by:peterdarazs
Comment Utility
Thanks ChloesDad - Much appreciated and hope you have a good day there.

Peter
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

772 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

13 Experts available now in Live!

Get 1:1 Help Now