S
Srikanth
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.
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.