Results 1 to 2 of 2

Thread: Printing

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    1
    I'm using the code below to show a printer dialog, then print out the contents of a richtextbox. Although this works, the default paper size used is 'letter' whereas I want it to be 'A4'. So what I want to do is make the paper size in the properties screen of the print dialog to default to 'A4' rather than letter. How do I do this? I tried adding a "Printer.PaperSize=vbPRPSA4" before
    the ShowPrinter call, but that didn't work.
    Any ideas?

    ----- code snippet ------

    CommonDialog1.CancelError = True
    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
    If msg.SelLength = 0 Then
    CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
    Else
    CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
    End If
    On Error Resume Next
    CommonDialog1.ShowPrinter
    If Err <> 32755 Then ' if cancel wasn't selected
    Printer.Print ""
    Richtextbox1.SelPrint CommonDialog1.hDC
    End If
    Printer.EndDoc
    ---------------------------

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    I suspect that, Letter size is the defualt for the printer.

    Before opening the dialog try this.

    Code:
    Printer.PaperSize = 9
    Iain, thats with an i by the way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width