Ok I’ve given up on the printer object and since there is no shortage of complaints about it I said to myself; what’s another question among the 100’s? So here goes:
I am trying to create a very simple address label using some very basic code. For some reason whenever I test the code the printer always prints an extra blank page.
I have tried to set the scaleMode to Twips, inches, millmeters etc… nothing worked.
I’ve also tried setting the scaleHeight and scaleWidth and still nothing that prevents the blank paper from coming out. Even when I set the two mentioned properties to only 1!
I think it is worth mentioning that I am printing over a network printer.
Here is the code which I am using:
Dim PRN As Object
Private Sub Form_Load()
Dim YPos As String
Dim str As String
Dim fnt As New StdFont
str = "test"
fnt.Name = "Verdana": fnt.Size = 11: fnt.Bold = True
CommonDialog1.CancelError = True
Set PRN = Printer
.PaperSize = vbPRPSLetter
.ScaleWidth = 11222
.ScaleHeight = 11904
.CurrentX = 30
.CurrentY = 1
.CurrentX = 0
.CurrentY = PRN.CurrentY + 5
YPos = PRN.CurrentY
On Error Resume Next
If Err.Number = 32755 Then
On Error GoTo 0
If CommonDialog1.Orientation = cdlLandscape Then
Printer.Orientation = cdlLandscape
Set PRN.Font = fnt
Private Sub ClearPrintoutArea()
If PRN Is Printer Then