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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer capabilities

Status
Not open for further replies.

Luix

Technical User
Jan 28, 2001
7
ES
Is there a way to find out wether a printer can print on a custom paper size or not by using an API call?
 
Maybe. If you can determine the various codes for PaperSize you could then read the printer info for PaperSize, store it temporarily, and then try to set the PaperSize for the value you are testing. If you get an error then it is safe to assume that that printer does not have that capability.

Public Sub GetPtrInfo()

Dim prt As Printer
Dim prp As Properties
Dim ptrCnt As Integer

On Error GoTo HandleErr

ptrCnt = Printers.Count
For ptrCnt = 0 To Printers.Count
Set prt = Printers(ptrCnt)
Debug.Print prt.DeviceName & " " & vbCrLf _
& " DefaultSize " & prt.DefaultSize & vbCrLf _
& " PaperBin " & prt.PaperBin & vbCrLf _
& " PaperSize " & prt.PaperSize & vbCrLf _
Next ptrCnt

Exit_Proc:
Exit Sub

HandleErr:
If Err.Number = 5 Then Resume Exit_Proc

End Sub

With Forms(0).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top