CDLM14
03-14-2014, 05:45 AM
Hi all!
I am working on a project which requires me to merge word documents from VBA. Something like "Word Doc1 + Word Doc2 = Word Doc3". While doing a search of the forums I found the following code posted by SnB:
Sub M_snb()
With Getobject("G:\OF\doc1.docx")
.content.insertafter getobject("G:\OF\doc2.docx").content
.saveas2 "G:\doc3.docx",12
.close False
End With
End Sub
This is wonderful. However it only transfers the content of the document and not any formatting or styles.
Does anyone have an idea as to how I can go about this?
Thanks very much!
I am working on a project which requires me to merge word documents from VBA. Something like "Word Doc1 + Word Doc2 = Word Doc3". While doing a search of the forums I found the following code posted by SnB:
Sub M_snb()
With Getobject("G:\OF\doc1.docx")
.content.insertafter getobject("G:\OF\doc2.docx").content
.saveas2 "G:\doc3.docx",12
.close False
End With
End Sub
This is wonderful. However it only transfers the content of the document and not any formatting or styles.
Does anyone have an idea as to how I can go about this?
Thanks very much!