If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Merging Multiple documents having different headers and footers ma
Dear All,
I am trying to merge a several word/rtf documents into a single word documents with the below macro, the problem is now each document is having a different header and footer and some fields, Can anyone suggest me a macro code for merging multiple word documents into a single document without disturbing the headers and footers of each document? Sub MergeDocs() Dim rng As Range Dim MainDoc As Document Dim strFile As String Const strFolder = "c:\tes\" 'change to suit Set MainDoc = Documents.Add strFile = Dir$(strFolder & "*.doc") ' can change to .docx Do Until strFile = "" Set rng = MainDoc.Range rng.Collapse wdCollapseEnd rng.InsertFile strFolder & strFile strFile = Dir$() Loop End Sub Thanks in advance. |
Thread Tools | |
Display Modes | |
|
|