Macro to change default printer and then restore original default printer settin 
Author Message
 Macro to change default printer and then restore original default printer settin

Is there a script to capture the current default printer,  
change the printer to another one & then restore the
original default printer settings once the document has
printed?


Fri, 02 Dec 2005 14:53:41 GMT  
 Macro to change default printer and then restore original default printer settin
That is quite simple to do and a great way of managing multiple printers.

  Dim sCurrentPrinter As String
  sCurrentPrinter = ActivePrinter
    ActivePrinter = "WinFax"
    Application.PrintOut FileName:=""
    ActivePrinter = sCurrentPrinter

Change "WinFax" to reflect the name of the printer you wish to print to.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
     Graham Mayor -  Word MVP

   Web site www.gmayor.dsl.pipex.com
  Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

Quote:

> Is there a script to capture the current default printer,
> change the printer to another one & then restore the
> original default printer settings once the document has
> printed?



Fri, 02 Dec 2005 15:27:19 GMT  
 Macro to change default printer and then restore original default printer settin

Quote:
>-----Original Message-----
>That is quite simple to do and a great way of managing
multiple printers.

>  Dim sCurrentPrinter As String
>  sCurrentPrinter = ActivePrinter
>    ActivePrinter = "WinFax"
>    Application.PrintOut FileName:=""
>    ActivePrinter = sCurrentPrinter

>Change "WinFax" to reflect the name of the printer you
wish to print to.

>--
><>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
>     Graham Mayor -  Word MVP

>   Web site www.gmayor.dsl.pipex.com
>  Word MVP web site www.mvps.org/word
><>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>


>> Is there a script to capture the current default
printer,
>> change the printer to another one & then restore the
>> original default printer settings once the document has
>> printed?

>.
>Brilliant.  Thank you Graham.  Now,  can you tell me if

it is possible to execute a macro on opening a document?  
ie: the user does not need to click a button,  the macro
just runs on opening?
Thankyou.


Sat, 03 Dec 2005 09:09:06 GMT  
 Macro to change default printer and then restore original default printer settin

Quote:

>> -----Original Message-----
>> That is quite simple to do and a great way of managing multiple
>> printers.

>>  Dim sCurrentPrinter As String
>>  sCurrentPrinter = ActivePrinter
>>    ActivePrinter = "WinFax"
>>    Application.PrintOut FileName:=""
>>    ActivePrinter = sCurrentPrinter

>> Change "WinFax" to reflect the name of the printer you wish to print
>> to.

>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
>>     Graham Mayor -  Word MVP

>>   Web site www.gmayor.dsl.pipex.com
>>  Word MVP web site www.mvps.org/word
>> <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>


>>> Is there a script to capture the current default printer,
>>> change the printer to another one & then restore the
>>> original default printer settings once the document has
>>> printed?

>> .
>> Brilliant.  Thank you Graham.  Now,  can you tell me if
> it is possible to execute a macro on opening a document?
> ie: the user does not need to click a button,  the macro
> just runs on opening?
> Thankyou.

Yes, but this means inserting a macro (AutoOpen) in the *document*. This has
the potential to conflict with macro security settings which are a user
selectable option, so it is entirely possible that the user can set the
protection so that the macro doesn't run. The toolbar button solution is
more practical.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
     Graham Mayor -  Word MVP

   Web site www.gmayor.dsl.pipex.com
  Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>



Sat, 03 Dec 2005 16:00:37 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Macro that selects printer and prints doc also changes default printer

2. Changing Printers property reset printer to Windows default printer

3. printer default to non-default printer

4. Running macro changes default windows printer

5. Problem setting the active printer of Word 97 without changing the Windows default printer

6. Using Printer common dialog changes default printer

7. How To Get Printer Dialog Not to Change Default Printer

8. Restore Printer Defaults

9. Restoring the default printer

10. Restoring the default printer

11. Changing printer without changing default

12. Printer, default or not default ?

 

 
Powered by phpBB® Forum Software