반응형
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal Milliseconds As LongPtr)
Sub BatchPrintWordDocuments()
Dim objWordApplication As New Word.Application
Dim strFile As String
Dim strFolder As String
strFolder = InputBox("폴더 주소 입력", "폴더 주소", "D:\temp\")
'strFolder = "D:\temp\"
strFile = Dir(strFolder & "*.docx", vbNormal)
While strFile <> ""
With objWordApplication
.Documents.Open (strFolder & strFile)
.ActiveDocument.PrintOut
.ActiveDocument.Close
End With
'Application.Wait (Now + TimeValue("0:00:30"))
Sleep (10000)
strFile = Dir()
Wend
Set objWordApplication = Nothing
End Sub
반응형
'엑셀' 카테고리의 다른 글
| 매크로에서 실행파일에 메시지 보내기 (32, 64bit 공용) (0) | 2026.02.09 |
|---|
댓글