Hello Everyone.
I have a vb6 program that basically shells a program that sends faxes from the command line. Unfortunately, the program xmedius sendfax only accepts 1 attachment. What I need to do is dynamically create a coversheet and dynamically create another document (the body). I successfully create both documents and I successfully merge the 2 documents, however the formatting on the 2nd document is lost and just takes on the margins, etc of the coversheet/1st document. Below is the code. My question would be... How do I preserve the formatting of the 2nd document?
Thank you,
-HDIS_Jesse
I have a vb6 program that basically shells a program that sends faxes from the command line. Unfortunately, the program xmedius sendfax only accepts 1 attachment. What I need to do is dynamically create a coversheet and dynamically create another document (the body). I successfully create both documents and I successfully merge the 2 documents, however the formatting on the 2nd document is lost and just takes on the margins, etc of the coversheet/1st document. Below is the code. My question would be... How do I preserve the formatting of the 2nd document?
Code:
Public Function MergeDocumentsIntoSingleOne(ByVal sFirstFile As String, ByVal sSecondFile As String, ByRef wrdapp As Word.Application) As Boolean
Dim docNew As Word.Document
Set docNew = wrdapp.Documents.Open(sFirstFile)
wrdapp.Selection.EndKey Unit:=wdStory
wrdapp.Selection.InsertBreak Type:=wdPageBreak
wrdapp.Selection.InsertFile FileName:=sSecondFile
'save the document
docNew.SaveAs "C:\NewFile.doc"
Set docNew = Nothing
End Function
-HDIS_Jesse