FIX: Cannot Change Page Settings During Print Job (180645)
The information in this article applies to:
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q180645 SYMPTOMS
When using the Printer object, you cannot change any page settings after
using the NewPage method. This includes Orientation, Height, Width,
PaperSize, PrintQuality, and PaperBin.
RESOLUTION
You cannot change page settings while printing to a page; however, you should be able to call the NewPage method, then make page setting changes before printing again. This allows the code to switch orientations, paper trays, paper size, and so forth, between pages. A bug in the Visual Basic 5.0 version of the NewPage method prematurely sets a flag that indicates printing on the new page has already started. So when you try to set a page property, such as Orientation, the following error is generated:
Run-time error '396':
'<Property>' property cannot be set within a page
where <Property> is the property you were trying to set.
Alternatively, you can print
with API functions exclusively without using the Printer object.
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.
REFERENCES
For additional information for an
example of changing Font information with this type of code, click on the article number below
to view the article in the Microsoft Knowledge Base:
175535 PRB: Printing Rotated Text with Visual Basic
For additional information on how ResetDC affects duplex printing, please
see the following article in the Microsoft Knowledge Base:
173197 PRB: ResetDC Disables Duplex Printing on PCL Printers
Modification Type: | Minor | Last Reviewed: | 3/11/2005 |
---|
Keywords: | kbBug kbfix kbprint kbVBp600fix KB180645 |
---|
|