View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Identifying Printer Name

You can also let the user provide the printer name and port with something
like this:

SelPrn = InputBox("TO SELECT A SPECIFIC PRINTER, ENTER THE SERVER NAME AND
PRINTER NAME IN THE FORMAT SHOWN IN THE SAMPLE BELOW:" & Chr(10) & Chr(10) &
"SAMPLE: \\PrtServer\" & ActivePrinter & Chr(10) & Chr(10) & "OR CLICK ON
CANCEL TO USE DEFAULT PRINTER.", "SELECT PRINTER")
SelPrn = UCase(SelPrn)
If SelPrn = False Or SelPrn = "" Then
Prn = ActivePrinter
Else
Prn = SelPrn
End If
ActiveSheet.PrintOut ActivePrinter:=Prn

Where PrtServer would be replaced with the users server name, and
ActivePrinter will show their current printer data.

"Marvin" wrote:

My workbook is distributed to several users. In my macros, I have a
customized PRINT macto that prints to an ADOBE ACROBAT printer.

The printer has a different name on each of the PCs belonging to my users.
For example:
"Adobe PDF on Ne03:"
"Adobe PDF on Ne09:"
"Adobe PDF on Ne02:"
Is there any way I can programatically determine the printer name so that
the user does not have to customize the macro?

Thanks.