Opening Multilple Documents at Once

E

e125

Adobe 7.0 has a very useful feature in its document organizer. If working on
multiple pdfs for a project, the user can create a collection with all these
documents. With a click of a button one can open all documents
simultaneously. Does word have the capability of doing something like this?
 
G

George Lee

Without using FSO (file system objects) or Google to find existing examples,
here’s a purely VBA way of doing it. Of course, there’s a lot of variations
depending on your needs.

Sub MyMultipleOpen()
Dim i As Integer
Dim doc As Word.Document

With Application.FileSearch
.NewSearch
.LookIn = "c:\MyFolder"
.SearchSubFolders = False
.FileType = msoFileTypeWordDocuments

If Not .Execute() = 0 Then
For i = 1 To .FoundFiles.Count
Set doc = Documents.Open(.FoundFiles(i))
'Do your stuff here, including closing and saving the doc as
needed.
Next i
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top