![]() |
#1
|
|||
|
|||
![]()
I have tried macros found on the web but they don't work right. I need to merge multiple files in Word 2010, insert a page break after each file, and especially preserve all the formatting and images on each original file. This will merge the files but no page break and formatting messed up:
Sub MergeDocs() Dim rng As Range Dim MainDoc As Document Dim strFile As String Const strFolder = "V:\1 My Documents\cjd\Recipes\2011\MergeTest\" 'change to suit Set MainDoc = Documents.Add strFile = Dir$(strFolder & "*.docx") ' can change to .docx Do Until strFile = "" Set rng = MainDoc.Range rng.Collapse wdCollapseEnd rng.InsertFile strFolder & strFile strFile = Dir$() Loop End Sub Other variations, such as merge as images, have runtime errors. Any suggestions? Thank you |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formatting macro | Ulodesk | Word Tables | 9 | 04-10-2012 06:37 PM |
![]() |
psrs0810 | Excel | 2 | 10-25-2010 01:49 PM |
![]() |
StarWeaver | Excel | 1 | 03-02-2010 01:41 PM |
Macro to export document sections to individual txt files? | MJMR999 | Excel Programming | 0 | 02-18-2010 12:49 PM |
Help-overwriting files-could it be macro virus? | Timpotty | Word | 0 | 03-06-2009 04:28 PM |