可以参考一下: Public Function SelPrinter(ByVal sPrinterTarget As String) As String Dim cPNR As Printer Dim sPrinterNow As String sPrinterNow = Printer.DeviceName If sPrinterNow = sPrinterTarget Then GoTo SelEnd: For Each cPNR In Printers If cPNR.DeviceName = sPrinterTarget Then Set Printer = cPNR GoTo SelEnd: End If Next SelPrinter = Chr(0) Exit Function SelEnd: SelPrinter = sPrinterNow End Function