Is that computer networked? I don't think you need to know the full printer
name to find which one is Adobe.
Anyway the post I linked to did not concatentate the full printer name -
sorry about that. I reposted the code from another of Tom Ogilvy's posts
which should be more helpful (and changed avTmp from a string to variant and
included a test for the word "Adobe").
My understanding is EnumPrinterConnections will return the printer names in
pairs (local name/network name - which is why the for loop increments by 2).
sConn finds the word "on" (which apparently is not universal). I included a
line to search the local name for "Adobe" and, when this is found, rebuild
the complete name of the printer and set the activeprinter to this printer.
You can, of course, store the activeprinter to a string variable, switch to
Adobe, then swich back to the previous printer.
I identified some lines that can be deleted if you have XL2000 or better
(previous versions did not have the Split function). If you have XL2000 or
better, you can delete those lines as well as the Split97 function.
Sub AdobePrinter()
Dim sConn As String, WshNetwork As Object, i As Long
Dim avTmp As Variant
#If VBA6 Then '<< Delete?
avTmp = Split(Excel.ActivePrinter, " ")
#Else '<< Delete?
avTmp = Split97(Excel.ActivePrinter, " ")'<< Delete?
#End If '<< Delete?
sConn = " " & avTmp(UBound(avTmp) - 1) & " "
Set WshNetwork = CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 To oPrinters.Count - 1 Step 2
If InStr(1, oPrinters.Item(i + 1), "Adobe", _
vbTextCompare) > 0 Then _
ActivePrinter = oPrinters.Item(i + 1) & _
sConn & oPrinters.Item(i)
Next
End Sub
Function Split97(sStr As String, sdelim As String) As Variant
Split97 = Evaluate("{""" & _
Application.Substitute(sStr, sdelim, """,""") & """}")
End Function