Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 12-27-2013, 02:58 AM
macropod's Avatar
macropod macropod is offline Insert multiple files Windows 7 32bit Insert multiple files Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub InsertFiles()
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String
strFolder = "C:\2\"
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "*.txt", vbNormal)
With Selection
  While strFile <> ""
    .InsertAfter strFile & vbCr
    .InsertFile FileName:=strFolder & strFile, ConfirmConversions:=False, Link:=False
    .InsertAfter vbCr & vbCr
    .Collapse wdCollapseEnd
    strFile = Dir()
  Wend
End With
Application.ScreenUpdating = True
End Sub
Note how minimal are the changes to the 'InsertFiles' sub from the code I originally posted.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert multiple files find files and insert filepaths userman Excel Programming 3 05-11-2012 02:53 PM
Cannot insert audio files unless speakers/headphones are present. HELP! brennj4 PowerPoint 0 01-04-2012 11:05 AM
Macro to Insert Text Into Cells Having Multiple Lines revans611 Excel Programming 4 10-24-2011 10:15 AM
Insert multiple files PPT 2010 will only insert, not link to audio files. kevin3d PowerPoint 1 10-07-2011 09:17 PM
Insert multiple files convert multiple csv files to multiple excel files mit Excel 1 06-14-2011 10:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft