I have used the macro below with great success! I am curious to know how to
modify the code to get the macro to look in several folders for a single
document. For instance, I may have Folder#1, Folder#2, Folder#3, Folder#4,
etc., and maybe as many as 50 different folders within one folder. How can I
get the macro to search through each of these folders and check for a certain
document, with a name such as “Coverage Terms”? If a document with a certain
name is found, I’d like to copy/paste, append, whatever, to my main document
(that I run the macro from). I guess I need a line or two of code right
after the line:
.LookIn = "F:\Microsoft Word"
Sub Append()
Dim i As Long
Application.ScreenUpdating = False
Documents.Add
With Application.FileSearch
'Search in foldername
.LookIn = "F:\Microsoft Word"
.SearchSubFolders = False
.FileName = "*.doc"
.Execute
For i = 1 To .FoundFiles.Count
If InStr(.FoundFiles(i), "~") = 0 Then
Selection.InsertFile FileName:=(.FoundFiles(i)), _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.InsertBreak Type:=wdPageBreak
End If
Next i
End With
End Sub

Signature
RyGuy
ryguy7272 - 27 Sep 2007 20:40 GMT
Got it with 2 extremely minor changes:
.SearchSubFolders = True
.FileName = "Updates*.doc"
Sub Append()
Dim i As Long
Application.ScreenUpdating = False
Documents.Add
With Application.FileSearch
.LookIn = "F:\Microsoft Word"
.SearchSubFolders = True
.FileName = "Updates*.doc"
.Execute
For i = 1 To .FoundFiles.Count
If InStr(.FoundFiles(i), "~") = 0 Then
Selection.InsertFile FileName:=(.FoundFiles(i)), _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.InsertBreak Type:=wdPageBreak
End If
Next i
End With
End Sub
I'm more used to VBA in Excel; VBA in word is still quite intimidating for me.
Hope this (simple) solution helps others.

Signature
RyGuy
> I have used the macro below with great success! I am curious to know how to
> modify the code to get the macro to look in several folders for a single
[quoted text clipped - 26 lines]
> End With
> End Sub