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

2­Óvba°ÝÃD

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

TOP

¦^´_ 2# Hsieh

ÁÂÁ¤j¤j
¦ý¤£ª¾©ñ¦b¨º¸Ì><

¥i¥H³o¼Ë¼g¶Ü?
Sheet2.Select
if  §ä¤£¨ì¦C¦L¾÷ then
msgbox ¨S¦³¦C¦L¾÷
end
else
ActiveSheet.PrintOut from:=1, To:=1, copies:=1

¬õ¦â¨º¥y§Ú¤£ª¾¦p¦ó¼g><
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¥»©«³Ì«á¥Ñ 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

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD