ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   function to convert Printer share name to ActivePrinter string (https://www.excelbanter.com/excel-programming/386577-function-convert-printer-share-name-activeprinter-string.html)

Matt Williamson

function to convert Printer share name to ActivePrinter string
 
I'm trying to figure out a way to convert the sharename of a network printer
to the format that ActivePrinter.PrintOut needs so I can specify which
printer to use. I've recored changing to the printer in question and it
shows up as "HP LaserJet 4050 series PCL6 on Ne05:" but I have no idea how
to determine this programatically. I'd much rather just specify the UNC path
and printer sharename. I found this http://tinyurl.com/2ovpms function that
does it for 2k+, but I still need it to work under 97 for a few months. Any
suggestions appreciated.

TIA

Matt



Jim Cone

function to convert Printer share name to ActivePrinter string
 
Matt,
It appears that keepItcool's code will not work in XL97
because of his use of the Split function.
You could try replacing the Split function with Tom Ogilvy's
Split97 function that works in XL97...

Function Split97(sStr As String, sDelim As String) As Variant
Split97 = Evaluate("{""" & Application.Substitute(sStr, sDelim, """,""") & """}")
End Function

I have not tried/tested my suggestion, so you are on your own.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Matt Williamson"
wrote in message
I'm trying to figure out a way to convert the sharename of a network printer
to the format that ActivePrinter.PrintOut needs so I can specify which
printer to use. I've recored changing to the printer in question and it
shows up as "HP LaserJet 4050 series PCL6 on Ne05:" but I have no idea how
to determine this programatically. I'd much rather just specify the UNC path
and printer sharename. I found this http://tinyurl.com/2ovpms function that
does it for 2k+, but I still need it to work under 97 for a few months. Any
suggestions appreciated.
TIA
Matt




All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com