INFO: ActivePrinter Property in Word Sets System Default Printer (216026)



The information in this article applies to:

  • Microsoft Office Professional Edition 2003
  • Microsoft Office XP Developer
  • Microsoft Office 2000 Developer
  • Microsoft Word 97 for Windows

This article was previously published under Q216026

SUMMARY

When you use the ActivePrinter property in Word to set the current printer, you also set the printer you select to be the default printer for the system. If you do not want to change the setting for the default system printer, do not use the ActivePrinter property.

MORE INFORMATION

To select a new printer without having Word change the default system printer, use the WordBasic FilePrintSetup method with the DoNotSetAsSysDefault flag set to True. For example, instead of using the following code:
   Set oWord = CreateObject("Word.Application")
   oWord.ActivePrinter = "HP LaserJet 4 on LPT2"
				
Use the following:
   Set oWord = CreateObject("Word.Application")
   oWord.WordBasic.FilePrintSetup Printer:="HP LaserJet 4 on LPT2", _
      DoNotSetAsSysDefault:=1
				

REFERENCES

For additional information about the ActivePrinter property, click the following article numbers to view the articles in the Microsoft Knowledge Base:

162239 Sample code to retrieve the name of the active printer




177275 WD97: How to create a macro to change printer or fax driver


Modification Type:MinorLast Reviewed:12/29/2005
Keywords:kbAutomation kbinfo KB216026 kbAudDeveloper