Results 1 to 3 of 3

Thread: trying to center text with printer object

  1. #1
    Guest
    i don't know this seem's correct to me
    but it doesn't print anything...blank page
    the printer has arial font

    am i missing something here?

    Printer.ScaleMode = vbCharacters
    Printer.Font = "Arial"
    Printer.FontSize = 12
    Printer.CurrentX = (Printer.Width - Printer.TextWidth("Header")) / 2
    Printer.Print "Header"
    Printer.Print
    Printer.CurrentX = (Printer.Width - Printer.TextWidth("Information")) / 2
    Printer.Print "Information"
    printer.EndDoc

  2. #2
    Guest
    You just have the logic mixed up. Try this:
    Code:
    Printer.ScaleMode = vbCharacters
    Printer.CurrentX = (Printer.ScaleWidth / 2) - (Printer.TextWidth("Header") / 2)
    Printer.Print "Header"
    Printer.EndDoc

  3. #3
    Guest
    thank you megatron,

    you are right, that is the problem.




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