The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for
Windows, version 2.0
- Microsoft Visual Basic programming system for Windows, version 1.0
- Microsoft Windows versions 3.0 and 3.1
SYMPTOMS
Choosing the Generic / Text Only printer drivers in Microsoft Windows
versions 3.0 and 3.1 may cause incorrect printing results in Visual
Basic for Windows. Visual Basic expects to print 66 lines per page, but
the generic printer driver only prints 60 lines per page. This results
in six lines being printed on a separate page.
WORKAROUND
To work around the problem, select a different printer driver.
STATUS
Microsoft has confirmed this to be a bug in the Generic / Text Only
printer driver included with 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
When using the Generic / Text Only printer driver, the example below
prints 60 lines on the first page, 6 lines on the second page, and
then 60 lines on the third page. You may also encounter some lines
being overwritten also with the Generic / Text Only driver supplied
with Windows version 3.0.
Steps to Reproduce Problem
- From the Windows Control Panel, choose the Printers icon.
- From the Printers option, choose the Add Printer button.
- Select the Generic / Text Only printer driver.
- Choose the Install button. There is additional help on pages 145-147 of
the "Microsoft Windows version 3.0 User's Guide." Note: You may need
your Windows disks to install the Generic / Text Only driver.
- After the Generic / Text Only driver has been installed and is the
default printer, you can proceed to run a test in Visual Basic.
- Start Visual Basic or if Visual Basic is already running, choose New
Project from the File menu (ALT, F, N). Form1 is created by default.
- Add the following code to the Form_Click event procedure of Form1:
Sub Form_Click ( )
For i% = 1 to 200
Printer.Print "This is a test of line number ";i%
Next i%
Printer.EndDoc
End Sub
- From the Run menu, choose Start to run the program.
- Run the same code, by pressing the F5 function key and then click
Form1 once, to run the test. This should produce five pages of
text, the first and third pages should have 60 lines of text, while
the second and fourth pages will only contain 6 lines of text. The
fifth page should be half covered with lines of text. This is where
the problem is, Visual Basic sends 66 lines to be printed per page,
but the Generic / Text Only printer driver is setup to print only
60 lines. Then the printer driver does a formfeed, after printing
the 6 lines on the second page to go on to the third page. The
printer driver may also display a problem on some lines of code
being overwritten (every fifth line may be overwritten).
|