BUG: VB Printer.Width/Height Values Incorrect for Plotter

Last reviewed: June 21, 1995
Article ID: Q106495
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, version 3.0

SYMPTOMS

If you set up the HP Draftmaster II plotter with a paper size of A0 in the Windows Control Panel, Visual Basic returns incorrect values for the Printer.Width and Printer.Height properties. If you set the plotter's paper size to A3 or A4, then Printer.Width and Printer.Height return correct values.

CAUSE

The Printer.Width and Printer.Height properties are designed to receive an integer only. Plotter paper sizes often exceed an integer. This causes an overflow in the Width and Height properties.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Choose the Printers dialog from the Windows Control Panel.

  2. Select the "HP Draftmaster II (HP Plotter)" and click Add. Click Install to add this printer to the Installed Printers list.

    NOTE: Windows for WorkGroups installs the necessary files in the WINDOWS\SYSTEM directory.

  3. Make "HP Draftmaster II (HP Plotter)" the default printer.

  4. Click Setup. Select the options DEVICE.DRAFTMASTER II and SIZE.A0. Click OK.

  5. Click Close to close the Printers dialog.

  6. Start Visual Basic.

  7. Press the F5 key followed by CTRL+BREAK.

  8. Activate the Debug window and execute the following statements:

    Debug.Print Printer.Width Debug.Print Printer.Height

The problem is that Printer.Width and Printer.Height return incorrect values such as 161.


Additional reference words: buglist3.00 3.00 Hewlett-Packard H-P
KBCategory: kbprg kbbuglist
KBSubcategory: PrgOther


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.