Printing landscape view

Hi All - I’d like to print out some text but in landscape, not portrait. I thought this would be simple and attempted using the following

[code] // Calling the overridden superclass constructor.
Super.Window
self.hide()
editfield1.Text=mys0

Dim g as Graphics
Dim stp as StyledTextPrinter
dim colwidth as integer = 261
dim spacebetweencols as integer = 18
dim myheight as integer = 4*72
dim coltoprint as integer
dim ncols as integer = 4

g= OpenPrinterDialog()
If g <> Nil then
stp=EditField1.styledTextPrinter(g,72*7.5)
stp.width=colwidth

coltoprint=1
Do until stp.eof
  stp.DrawBlock (colwidth+spacebetweencols)*(coltoprint-1), 0, myheight
  
  if coltoprint=ncols then
    if not stp.eof then
      g.NextPage
      coltoprint=1
    end if
  else
    coltoprint=coltoprint+1
  end if
  
  
Loop

End if

self.close()[/code]

but the result was two columns in view and a third running off the page and the lower half of my page being blank.

EDIT: So it looks like maybe I need a printer setup object? But is there a way to change to landscape layout without opening the print dialog… making progress

  Dim thePS As New PrinterSetup
  thePS.Landscape=p.Orient
  
  
  //theps.MaxHorizontalResolution=-1
  //theps.MaxVerticalResolution=-1
  
  g=OpenPrinterDialog(thePS)
  If g=Nil Then Exit Sub

thanks Dave. Just realized this is in customer service too, sorry about that.

and p.orient is either TRUE or FALSE
(I cut and pasted this from one of my projects)

ha, forgot all about that property!