Dim printer As String printer = Application.ActivePrinter strDeviceName = Split(printer, " on ")(0) strDevicePort = Split(printer, " on ")(1)