Results 1 to 6 of 6

Thread: [RESOLVED] Printing a Form

  1. #1

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Resolved [RESOLVED] Printing a Form

    I am running VB6 on WIN10.

    I found I can print a form using the following code

    " Printer.Orientation = 2 'LANDSCAPE Printer.PrintQuality = vbPRPQHigh '-4
    Printer.ColorMode = vbPRCMColor '2
    Me.PrintForm
    "

    How can I center the form horizontally on the paper?
    The data is already centered when displayed on the screen.

    Also, all the 'text' (really label boxes are printing correctly except for one. The page title is printing with a larger font size. I need the original font size for screen display. Do I just change the font size temporarily for printing and then change it back?

    Thanks

  2. #2

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Printing a Form

    I have added the following code
    "Printer.CurrentX = (Printer.Width - Me.Width) / 2"
    I thought that I should center the form on the paper the same way you center the form on the screen. This didn't work. The results were the same. Could it be that units for Printer.width and me.width don't match.

    I'm checking not to find out what the default units are.

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Printing a Form

    PrintForm was meant for printing "screenshots" to be filed as documentation, nothing else.

    Generally you would choose a low printer resolution (like 100dpi) in order to fill more of the page. This assumed your display(s) were at 96dpi, the old Windows standard.

    The method takes fairly complete control so there isn't a lot that can modify the result.

    In any case it was never meant as a reporting tool.

  4. #4

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: Printing a Form

    Problem solved - not very elegant.

    I made the form wider. Then I moved all the data to the right. I made a border of about 1.125" on each side. After some ink and paper I got the data centered on the paper.

  5. #5
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: [RESOLVED] Printing a Form

    Using PrintForm it is not possible to change the position of the printing.

  6. #6
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: [RESOLVED] Printing a Form

    Also PrintForm can have some misalignment of text in controls (I have noticed), and is fuzzy.
    Yell out if you would prefer better solutions.

    Rob
    PS Long ago I decided to never use printform again

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