INFO: ActivePrinter Property in Word Sets System Default Printer

ID: Q216026


The information in this article applies to:


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, please see the following article(s) in the Microsoft Knowledge Base:

Q162239 Sample Code to Retrieve the Name of the Active Printer
Q177275 WD97: How to Create a Macro to Change Printer or Fax Driver

(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Richard R. Taylor, Microsoft Corporation.

Additional query words:


Keywords          : kbAutomation KbVBA kbWord kbGrpDSO 
Version           : WINDOWS:97
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: February 9, 1999