Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center Print

Status
Not open for further replies.

briancoats

Programmer
May 1, 2003
61
US
I know there has to be a way though I don't know what it ir. How do you use the printer. object and tell it to center the print on the page?

Brian Coats

p.s. I figure this will rate as an easy one for someone.
 

Hmmm... Something like...
[tt]
Option Explicit

Private Sub Form_Load()

Dim L As Long, T As Long, WL As Long, WT As Long

L = Printer.Width
T = Printer.Height

WL = Printer.TextWidth("This is a test")
WT = Printer.TextHeight("This is a test")

Printer.CurrentX = ((L / 2) - (WL / 2))
Printer.CurrentY = ((T / 2) - (WT / 2))

Printer.Print "This is a test"
Printer.EndDoc

End Sub
[/tt]

Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top