Article ID: 173981
Article Last Modified on 5/13/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
- Microsoft Visual Studio .NET 2002 Professional Edition
- Microsoft Visual Basic 6.0 Learning Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
- Microsoft Visual Studio .NET 2002 Professional Edition
- Microsoft Visual Basic 5.0 Professional Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
- Microsoft Visual Basic 6.0 Professional Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
- Microsoft Visual Basic 5.0 Enterprise Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
- Microsoft Visual Basic 6.0 Enterprise Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
- Microsoft Visual Basic 4.0 Standard Edition, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Standard Edition
This article was previously published under Q173981
SYMPTOMS
On Windows XP, Windows 2000, or Windows NT 4.0, when you call the ShowPrinter method of the CommonDialog control, some of the properties of the Printer object, such as the Copies and the Orientation properties, are not affected by changes that the user selects in the Print dialog box.
This problem does not occur with the same properties of the Printer object on Microsoft Windows Millennium Edition (Me), Microsoft Windows 98, or Microsoft Windows 95.
CAUSE
This problem occurs because the Printer object and the CommonDialog control do not share information. The object and the control have their own device context. For more information, see the "References" section.
RESOLUTION
You can work around this problem for the properties that the
CommonDialog control exposes. To demonstrate this, replace the code for Form1 of the sample project in the "More Information" section with the following code, which assigns the property values from the
CommonDialog control to the
Printer object:
With CommonDialog1
.ShowPrinter
Printer.Copies = .Copies
Printer.Orientation = .Orientation
Debug.Print "Copies = " & CStr(Printer.Copies) & vbCrLf & _
"Orientation = " & CStr(Printer.Orientation)
End With
STATUS
This behavior is by design.
REFERENCES
For additional information about the
CommonDialog control, click the article number below to view the article in the Microsoft Knowledge Base:
198712 PRB: CommonDialog Changes System Wide Printer Properties
Keywords: kbapi kbcmndlg kbcmndlgpage kbcmndlgprint kbprb kbprint KB173981