Need VB code to determine "Active Printer" for TS users

D

Dirtbike

Folks:
I have a need to determine an active printer for a Terminal Services user.
When I Google "Determine Active Printer" I get lots of help in determining
the default printer. I don't think the default printer is what I want for a
TS user....I mean the servers default printer is not the "Active Printer" the
TS user brought with them. My Word2003 macro sets the Active Printer to my
CutePDF writer and does what I want but I would like to reset the printer to
what it was before I "set" it to the CutePDF deal.
Thank you soooooo much for the help here.
 
D

Dirtbike

I found it...finally when I Googled "Active Printer" as a string I got:

Sub GetActivePrinter()

' This constant is used to hold the title of the message box
Const Caption As String = "Active Printer Name"

' This variable is used to hold the name of the active printer
Dim PrinterName As String

' Assign the active printer to the variable
PrinterName = Application.ActivePrinter

' Display the message box
MsgBox PrinterName, vbInformation, Caption

End Sub

And it WORKS!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top