Microsoft KB Archive/113593

= FIX: Printer.Print Statements Unable to Print w/ Postscript =

Article ID: 113593

Article Last Modified on 10/29/2003

-

APPLIES TO


 * Microsoft Visual Basic 1.0 Standard Edition
 * Microsoft Visual Basic 2.0 Standard Edition

-



This article was previously published under Q113593



SYMPTOMS
Nothing prints on the paper when you try to print a string to the printer using the printer.print statement. Nothing prints when code processing reaches the printer.enddoc statement or the end of the program.



CAUSE
The following two Postscript printer drivers were tested and found to have a problem with Microsoft Visual Basic versions 1.0 and 2.0 for Windows. The drivers with the problem are:


 * PSCRIPT.DRV 318112 bytes dated 10-01-92
 * PSCRIPT.DRV 313520 bytes dated 3-02-92

The problem is that nothing prints on the paper. The Printer.Print statement(s) may be ignored entirely when you are using either of the two drivers listed above.



WORKAROUND
Add two statements prior to the Printer.Print statement(s) to correct the problem. You need to set the Printer.CurrentX and Printer.CurrentY properties to positive values. Then add the Printer.Print statement and you should see the desired string printed on the printer's page.



STATUS
Microsoft has confirmed this to be a bug in the products listed at the beginning of this article. This problem did not occur in Visual Basic version 3.0.



MORE INFORMATION
Note that you will need a PSCRIPT.DRV 318112 bytes 10-01-92 or PSCRIPT.DRV 313520 bytes dated 3-02-92 postscript printer driver to reproduce the problem outlined below.

Steps to Reproduce Problem
 Start a new project in Visual Basic. Form1 is created by default. Add a Command button (Command1) to Form1.  Add the following code to the Command1 click event procedure: Sub Command1_Click Printer.Print "This is a test of the Postscript printer driver" printer.enddoc End Sub  Run the program and click the Command1 button. You should see a blank piece of paper printed out if you have one of the specified drivers.

Additional Steps to Work Around the Problem
  To work around the problem, add two lines of code to the Command1 click event procedure: Sub Command1_Click printer.CurrentX = 1 printer.CurrentY = 1 printer.Print "This is a test of the Postscript printer driver" printer.EndDoc End Sub </li> Run the program and click the Command1 button. Now you should see the line of text: 'This is a test of the Postscript printer driver' printed on the paper.</li></ol>

Additional query words: buglist1.00 buglist2.00 fixlist3.00 2.00 buglist1.00 buglist2.00 fixlist3.00

Keywords: kbbug kbfix KB113593

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.