Hello,
I’m unable to figure out how to combined documents while keeping section break continues in the correct spots.
I have a series of documents that i’m combining using a mixture of
outputDoc.LastSection.AppendContent(doc.Sections(0))
When i simply want the text added to the doc as in the attached documents for “Firm Overview” and "Pro Bono"
When my code needs to merge in a “New Separator” document it uses AppendDoc
Public Sub AppendDoc(ByVal dstDoc As Document, ByVal srcDoc As Document)
For Each srcSection As Section In srcDoc
Dim dstSection As Section = CType(dstDoc.ImportNode(srcSection, True, ImportFormatMode.UseDestinationStyles), Section)
dstSection.PageSetup.SectionStart = SectionStart.NewPage
dstDoc.Sections.Add(dstSection)
Next srcSection
End Sub
The issues is when i need to have a SectionBreakContinues followed by the NewPage for each “New Separator” type page so that the text in the columns is balanced out. If i try to use
builder.InsertBreak(BreakType.SectionBreakContinuous) at the end of the Pro Bono doc or at the beginning of the “New Separator” doc, when i append the docs together the SectionBreakContinuous is gone.
The document correct.docx shows you i would like it to look.
We are using version 13.3 of aspose.words for .net