
20개의 개별 Word 문서를 인쇄해야 합니다. 나는 각각을 열고 클릭하고 싶지 않습니다인쇄.
한꺼번에 인쇄할 수 있나요?
답변1
창에서는 여러 파일을 마우스 오른쪽 버튼으로 클릭하고 인쇄를 선택하면 선택한 모든 파일이 인쇄됩니다.
그러나 내 테스트에서는 한 번에 최대 15개의 문서까지만 작동합니다. (잘못된 폴더를 인쇄하여 우발적인 재앙을 방지하기 위한 것 같습니다.)
답변2
나는 이것이 단지 한 번만 필요한 것 이상이라고 생각합니다. 그렇지 않으면 Windows UI를 사용하여 여러 문서를 선택하고 마우스 오른쪽 버튼을 클릭하고 인쇄를 선택할 수 있습니다.
매크로가 허용됩니까? 매크로에서 Word 문서를 열고 인쇄하는 데 필요한 기본 코드는 다음과 같습니다.
Sub PrintDocMacro()
Dim objWord As Object
Set objWord = CreateObject("Word.application") 'Start app
objWord.Documents.Open FileName:="c:\Temp\test.docx" 'Open doc
objWord.Visible = True
objWord.Application.PrintOut 'Print doc
objWord.ActiveDocument.Close savechanges:=True 'close & save doc
objWord.Application.Quit 'Close app
Set objWord = Nothing
End Sub
원하는 모든 문서를 인쇄하려면 루프를 작성해야 합니다. 인쇄하려는 문서가 특정 폴더에 있는 모든 문서인 경우에도 그렇게 할 수 있습니다. 마이크로소프트는예제 코드디렉토리를 읽는 데 사용됩니다.
어떤 이유로든 일정에 따라 인쇄하려는 경우 매크로가 포함된 파일을 AutoOpen으로 실행하고 완료되면 닫고 작업 스케줄러를 통해 해당 매크로 지원 파일이 열리도록 예약할 수 있다고 가정합니다.
답변3
나는 이것이 오래된 질문이라는 것을 알고 있지만 여기서 사용하는 대답을 보지 못했습니다.
Windows 탐색기 셸에서 마우스 오른쪽 버튼 클릭 옵션을 사용하여 여러 문서를 인쇄할 수 있습니다. 일반적으로 문서 제한은 15개입니다. 하지만,해당 제한은 레지스트리에서 변경될 수 있습니다. 필요한 한도로 수정할 값은 다음과 같습니다.
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer
Name : MultipleInvokePromptMinimum
Type : DWORD
Default : 15 (decimal)
누군가가 매크로를 사용하는 수고를 덜어주기를 바랍니다.
답변4
이것은 폴더를 지정하고 하위 폴더를 포함하여 이 폴더 내의 모든 단어 파일을 인쇄할 수 있는 매크로입니다.
Public optionCancel
Sub Print_word_files()
Dim path
Dim reminder As Integer
Dim oExtension As String
Dim Fso, oFolder, oSubfolder, oFile, queue As Collection
On Error Resume Next
path = " " //######################put files path here (ex: c:\users\myFiles) ################
If optionCancel = "yes" Then
optionCancel = "No"
Exit Sub
End If
reminder = MsgBox("Are you sure you want to print these files?", 4, "WARNING !!")
If reminder = 6 Then 'If Yes is clicked
Set Fso = CreateObject("Scripting.FileSystemObject")
Set queue = New Collection
queue.Add Fso.GetFolder(path) 'The path
Do While queue.Count > 0
Set oFolder = queue(1)
queue.Remove 1 'dequeue
'...insert any <<folder>> processing code here...
For Each oSubfolder In oFolder.subfolders
queue.Add oSubfolder 'enqueue
Next oSubfolder
For Each oFile In oFolder.Files
oExtension = Right(oFile, Len(oFile) - InStrRev(oFile, ".", -1)) 'gets the file extension
If oExtension = "docx" Or oExtension = "DOCX" Or oExtension = "doc" Or oExtension = "DOC" Or oExtension = "docm" Or oExtension = "DOCM" Or oExtension = "rtf" Or oExtension = "RTF" Then
Documents.Open FileName:=(oFile)
'-------------------The required starts here
ActiveDocument.PrintOut 'Prints document
ActiveDocument.Saved = True 'to prevent asking to save
ActiveDocument.Close 'Closes document
'-------------------The required ends here
End If
Next oFile
Loop
Else
MsgBox ("Operation cancelled!!")
End If
End Sub