This does pull all the content in BUT it does not put the filenames in the resulting document like the previous version did.
Quote:
Originally Posted by Guessed
Try this version
Code:
Sub Import_Text()
Dim strFolder As String, strFile As String, wdDoc As Document
Application.ScreenUpdating = False
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.rtf", vbNormal)
ChangeFileOpenDirectory strFolder
Set wdDoc = ActiveDocument
While strFile <> ""
wdDoc.Range.Paragraphs.Last.Range.InsertFile FileName:=strFolder & "\" & strFile, ConfirmConversions:=False, Link:=False, Attachment:=False
strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String
Dim oFolder As Object
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
|