Avatar of sp
sp
 asked on

Printing issue on VB6 using Printer Object Property "PaperSize" for custom size paper

Having issues while printing custom size paper (8.5X7) on manual tray of Xerox (Work Center 7545) Printer. Even though specifying the printer to pull paper from the manual feed its pulling from the default tray. Below is the code I'm using

Code:
Dim x1 As Printer
    For Each x1 In Printers
     If x1.DeviceName = Printer.DeviceName Then
            Set Printer = x1
            Printer.Height = (7 * 1440)
            Printer.Width = (8.5 * 1440)
            Printer.PaperSize = vbPRPSUser
            Printer.PaperBin = 258 'Mannual
            Exit For
        End If
    Next
Printers and ScannersVisual Basic Classic

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Martin Liss

Try vbPRBNManual (which has a value of 4) instead of 258.

This page lists the properties.
sp

ASKER
Hello Martin,
Thank you for your response. Getting "Invalid Property value" when i set the PaperBin value to vbPRBNManual.
Martin Liss

Maybe this Microsoft article will be of some use.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
Karen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Martin Liss

Good idea Karen.