I am combining a few documents together and it seems that my shapes and textboxes are moving all over the place. I have attached the documents I am using as source documents and then my final output.
Here is the code I used to combine them together:
Dim objLic As New Aspose.Word.License objLic.SetLicense(Application.StartupPath & “\Aspose.Word.lic”) Dim BODY As New Aspose.Word.Document(“C:\Documents and Settings\jkoerner\desktop\pre-test.doc”) Dim db As New Aspose.Word.DocumentBuilder db.Document.Sections.Clear() 'db.Document.Sections.Add(New Aspose.Word.Section(db.Document)) Dim objSource As Aspose.Word.Section Dim objDest As Aspose.Word.Section Dim i As Integer For i = 0 To Body.Sections.Count - 1 If i <> 0 Then objSource = BODY.Sections(i) objDest = db.Document.ImportNode(objSource, True) db.Document.Sections(db.Document.Sections.Count - 1).AppendContent(objDest) Else objSource = BODY.Sections(i) objDest = db.Document.ImportNode(objSource, True) db.Document.Sections.Add(objDest) End If Next BODY = New Aspose.Word.Document(“C:\Documents and Settings\jkoerner\desktop\test.doc”) For i = 0 To BODY.Sections.Count - 1 If i <> 0 Then objSource = BODY.Sections(i) objDest = db.Document.ImportNode(objSource, True) db.Document.Sections(db.Document.Sections.Count - 1).AppendContent(objDest) Else objSource = BODY.Sections(i) objDest = db.Document.ImportNode(objSource, True) db.Document.Sections.Add(objDest) End If Next db.Document.Save(“c:\Temp\Output.doc”) Dim p As New Process p.Start(“C:\Temp\output.doc”) |