Microsoft Knowledge Base Email Alertz

KBAlertz.com: (193243) - 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.

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








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

SUMMARY

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.

MORE INFORMATION

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.

REFERENCES

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
Keywords: 
kbcode kbhowto KB193243
       

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

James Huang - jz_huang@yahoo.com Report As Irrelevant  
Written: 4/3/2009 9:43 PM
How to set default printer from VB.NET with office automation without opening the print setup dialog box? Thanks!

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please