Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created September 21, 2009 02:48
Show Gist options
  • Save NigelThorne/190041 to your computer and use it in GitHub Desktop.
Save NigelThorne/190041 to your computer and use it in GitHub Desktop.
Sub InsertLotsOfFiles()
'
' InsertLotsOfFiles Macro
' Macro written 21/09/2009 by Nigel Thorne
'
Dim No_Of_Files As Integer
Dim kk25 As Integer
Dim File_Path As String
File_Path = "..." 'change this to the path you want to use.
With Application.FileSearch
.NewSearch
.LookIn = File_Path
.FileName = "*.*"
.SearchSubFolders = False
.Execute
No_Of_Files = .FoundFiles.Count
For kk25 = 1 To No_Of_Files
Selection.InsertFile FileName:=.FoundFiles(kk25), Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
Next kk25
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment