ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

2­Óvba°ÝÃD

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-8-7 23:45 ½s¿è

¦^´_ 1# basarasy
  1. Sub NN()
  2. If IsNumeric(Application.Match(Split(ActivePrinter, " on")(0), Printer_List, 0)) Then
  3. ActiveSheet.PrintOut
  4. Else
  5. MsgBox "§ä¤£¨ì¦Lªí¾÷"
  6. End If
  7. End Sub
  8. Function Printer_List() As Variant
  9. '³]©w¤Þ¥Î¶µ¥ØMicrosoft Shell Controls And Automation
  10. Dim MySh As Shell32.Shell
  11. Dim MyPrinter As Shell32.FolderItem
  12. Dim Ar()
  13. Set MySh = CreateObject("Shell.Application")
  14. For Each MyPrinter In MySh.Namespace(ssfPRINTERS).Items
  15.   If MyPrinter.Name <> "·s¼W¦Lªí¾÷" Then
  16.      ReDim Preserve Ar(s)
  17.        Ar(s) = MyPrinter.Name
  18.        s = s + 1
  19.   End If
  20. Next
  21. Printer_List = Ar
  22. End Function
½Æ»s¥N½X
°ÝÃD2À³¸Ó¬O¥ÑWindows¨Ó±±¨î¥i±qAPI¨ç¼Æ¥h§äµª®×
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

°õ¦æNN¬Ý¬Ý
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD