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

[µo°Ý] ½Ð±Ð«ç»ò¥´¦L.TXT¤åÀɨìprinter ?

[µo°Ý] ½Ð±Ð«ç»ò¥´¦L.TXT¤åÀɨìprinter ?

§Ú¤âÀY¤W¦³¤@­Ó  ¥ÎVBA Ū¨ú¤j¬ù60­Ó TXT¤å¥óªº¸ô®|   ¦p¥H¤U   ½Ð°Ý «ç»òµo°e¨ìPrinter ¦C¦L¥X¨Ó

C:\namelist.txt
C:\namelis1t.txt
C:\namelis2t.txt
C:\namelis3t.txt
C:\namelis4t.txt
C:\namelis5t.txt
C:\namelis6t.txt
C:\namelis7t.txt
C:\namelis8t.txt
C:\namelis9t.txt
C:\namelis10t.txt
C:\namelis11t.txt
C:\namelis12t.txt
C:\namelis13t.txt
C:\namelis14t.txt
C:\namelis15t.txt
.........

¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-6-7 05:28 ½s¿è

¦^´_ 1# adrian_9832
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim xPath As String, xBat As String, St As String, Msg As Boolean
  4.     xPath = "d:\"                 '«ü©wªº¸ê®Æ§¨
  5.     xBat = xPath & "Print.Bat"    'Bat-> DOS ¤U¦Û°Ê°õ¦æªºÀÉ®×
  6.     St = Dir(xPath & "*.txt", vbDirectory)   '¬d¬Ý«ü©w°ÆÀɦWªºÀÉ®×
  7.     If St <> "" Then
  8.         Msg = True
  9.         With CreateObject("Scripting.FileSystemObject").CreateTextFile(xBat, 1)      '«Ø¥ß¤@­ÓÀÉ®×
  10.             .Write "PRINT " & xPath & St & vbCrLf      '¼g¤J
  11.             St = Dir    '¬d¬Ý¤U¤@­ÓÀÉ®×
  12.             Do While St <> ""
  13.                 .Write "PRINT " & xPath & St & vbCrLf
  14.                 St = Dir
  15.             Loop
  16.             .Close
  17.         End With
  18.         If Msg Then Shell xBat  '°õ¦æµ{¦¡
  19.         Kill xBat    '§R°£¤@­ÓÀÉ®×
  20.     End If
  21. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

ÁÂÁ¤j¤jªº¦^´_
§Ú¸Õ¹L¤W¤èªº½s½X  ¦ý¬O§Úªº¬´¯»¥´¦L¾÷  ¨S¤ÏÀ³  §Ú·Q¥i¯à­n¦A§ä§ä°ÝÃD¦A¨º¸Ì

TOP

        ÀR«ä¦Û¦b : ¯¸¦b¥b¸ô¡A¤ñ¨«¨ì¥Ø¼Ð§ó¨¯­W¡C
ªð¦^¦Cªí ¤W¤@¥DÃD