Solved

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

Posted on 2016-10-14
6
37 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 47

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 47

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 47

Expert Comment

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

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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…

739 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