Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 193243 - Last Review: July 13, 2004 - Revision: 1.2
How To Set the Default Window's Printer Using OLE Automation
This article was previously published under Q193243
This article shows how you can use OLE automation to open the Printer Setup
dialog box in Word 97 for Windows and change the default Windows printer.
Microsoft Word has the ability to open a Printer Setup dialog box that
allows the user to select another printer as the default printer. The
following code demonstrates how to accomplish this task:
*** Begin code example ***
oWord=CREATEOBJECT("Word.Application")
dlg = oWord.Dialogs(97) && Open printer setup dialog box in Word.
WITH dlg
.Show
ENDWITH
oWord.Quit
*** End code example ***
When the code executes, a Printer Setup dialog box appears that contains
the current Windows printers. From this dialog box, you can reset the
current default printer. After choosing the printer, Word briefly appears
but then closes.
Microsoft Word Visual Basic Help
(c) Microsoft Corporation 1998. All Rights Reserved. Contributions by Dean
Christopher,
Microsoft Corporation.
APPLIES TO
- Microsoft Visual FoxPro 5.0a
- Microsoft Visual FoxPro 6.0 Professional Edition
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please