[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Batch print folders

Posted on 2011-10-21
6
Medium Priority
?
187 Views
Last Modified: 2013-11-05
I have a number of folders with word documents in them.
I would like to print them all, but can't figure out how to do it.

I have tried this:
http://www.ehow.com/how_7535595_print-contents-multiple-folders.html
The shell:to option is not showing when I am testing in on 2 folders with two documents.
Also it is not possible to drag the folders to the printer.
0
Comment
Question by:MissHappy
  • 2
  • 2
  • 2
6 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37005659
You could do that with a Word macro
Sub PrintDocsInFolder()
    Dim strFileName As String
    Dim doc As Word.Document
    Dim strFolder As String
    
    strFolder = "C:\Folder1"
    
    strFileName = Dir$(strFolder & "\*.doc*")
    Do Until strFileName = ""
        Set doc = Documents.Open(strFolder & "\" & strFileName)
        doc.PrintOut
        doc.Close False
        strFileName = Dir$()
    Loop
   
End Sub

Open in new window

0
 
LVL 6

Expert Comment

by:morpheios
ID: 37005683
Try use command-line

for /f "tokens=*" %a in ("dir /b PATH\*.doc") do "C:\Program Files\Microsoft Office\Office\winword.exe" "PATH\%a" /mFilePrintDefault

or

for /f "tokens=*" %a in ("dir /b PATH\*.docx") do "C:\Program Files\Microsoft Office\Office\winword.exe" "PATH\%a" /mFilePrintDefault
0
 

Author Comment

by:MissHappy
ID: 37005793
Do you mean like this?

for /f "tokens=*" %a in ("dir /b P:\test\*.docx") do "C:\Program Files\Microsoft Office\Office\winword.exe" "PATH\%a" /mFilePrintDefault

How can this type of command handle multiple folders such as test/test1/doc.docx, test/test2/doc2.docx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:MissHappy
ID: 37005881
I don't think any of these methods will work because this is intended for users where I work to be able to print zip-files they download with multiple folders and files easily.

It will be to complicated for them to start writing commands that have to be edited each time they download a folder or editing a macro because the path to the folder changes. each time.

Are there no simple ways to accomplish this?
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 37006259
This replaces the hard-coded folder name with a function to browse for the folder.
Sub PrintDocsInFolder()
    Dim strFileName As String
    Dim doc As Word.Document
    Dim strFolder As String
    
    strFolder = GetTheFolder
    
    strFileName = Dir$(strFolder & "\*.doc*")
    Do Until strFileName = ""
        Set doc = Documents.Open(strFolder & "\" & strFileName)
        doc.PrintOut
        doc.Close False
        strFileName = Dir$()
    Loop
   
End Sub

Function GetFolder() As String
    Dim i As Integer
     
    With Application.FileDialog(msoFileDialogFolderPicker)
        .Show
        For i = 1 To .SelectedItems.Count
            GetFolder = .SelectedItems(i)
        Next i
    End With
End Function

Open in new window

0
 
LVL 6

Expert Comment

by:morpheios
ID: 37006298
May be simple install 3d party software? For example http://www.awises.com/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question