Microsoft KB Archive/177740

= FIX: Scale Method Results in a Number of Blank Pages Printed =

Article ID: 177740

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q177740



SYMPTOMS
The Scale method of the Printer object prints a number of blank pages when the Scale values are set so that the first Y-coordinate value is greater than the second Y-coordinate value.



RESOLUTION
To work around this bug, set Y-coordinate values in the Scale method so the first Y-coordinate is less than the second Y-coordinate.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0.



MORE INFORMATION
This section shows you how to reproduce this bug.

NOTE: Set your default printer to print to a file if you want to reproduce this bug. Sending the output to a printer may result in many blank pages.

Steps to Reproduce Behavior
 Start a new Standard EXE project in Visual Basic. Form1 is created by default. Add two CommandButtons to Form1.  Copy the following code to the Code window of Form1: Option Explicit

Dim intCounter As Integer

Private Sub Form_Load Command1.Caption = "Demonstrate the Problem" Command2.Caption = "Demonstrate the Expected Behavior" End Sub

Private Sub Command1_Click 'This button demonstrates the problem.

Printer.Scale (0, 250)-(140, 0) 'Y-Coordinate is descending Printer.Print " "

For intCounter = 1 To 100 Printer.Print "Item #" & intCounter Next intCounter

MsgBox "# Pages : " & Printer.Page

Printer.EndDoc

End Sub

Private Sub Command2_Click 'This button demonstrates the expected behavior

Printer.Scale (0, 0)-(140, 250) 'Y-Coordinate is ascending Printer.Print " "

For intCounter = 1 To 100 Printer.Print "Item #" & intCounter Next intCounter

MsgBox "# Pages : " & Printer.Page

Printer.EndDoc

End Sub  Press the F5 key to run the program. Click Expected Behavior to determine how many pages are printed. Click Bug Behavior and note that the number of pages printed exceed that of the Expected Behavior button.

Additional query words: print job blank pages kbVBp500bug kbVBp600fix kbVBp kbdsd kbDSupport kbPrinting (c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Arsenio Locsin, Microsoft Corporation

Keywords: kbbug kbfix KB177740

-

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

© Microsoft Corporation. All rights reserved.