View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Identifying Printer Name

Dim iCtr as long
dim FoundIt as boolean

foundit = false
for ictr = 0 to 99
on error resume next
Application.activeprinter = "Adobe PDF on Ne" & format(ictr,"00") & ":"
if err.number = 0 then
foundit = true
exit for
else
'keep looking
err.clear
end if
next ictr
on error goto 0

if foundit = false then
msgbox "No printer close to that name"
else
'do the real work
end if

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.


--

Dave Peterson