Solved

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

Posted on 2016-10-14
6
39 Views
Last Modified: 2016-11-06
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
0
Comment
Question by:sp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 48

Expert Comment

by:Martin Liss
ID: 41844233
Try vbPRBNManual (which has a value of 4) instead of 258.

This page lists the properties.
0
 

Author Comment

by:sp
ID: 41846780
Hello Martin,
Thank you for your response. Getting "Invalid Property value" when i set the PaperBin value to vbPRBNManual.
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 41846877
Maybe this Microsoft article will be of some use.
0
 
LVL 9

Accepted Solution

by:
Karen earned 500 total points (awarded by participants)
ID: 41847617
You will need to find what the PaperBin value is for your particular printer.
To do this, go into your printer settings and change the printer to default to "Paper source" = "Manual Feed".
Then go into your VB program and see what the PaperBin value is:
MsgBox Printer.PaperBin
or
Debug.Print Printer.PaperBin
will give you the number to use.
Now you can change your printer settings back to what they were before.
1
 
LVL 48

Expert Comment

by:Martin Liss
ID: 41848535
Good idea Karen.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question