Introduced in build 4.1.0.1494
Description
Appends an existing Document to the end of the current Document, separated by a next-page section break
C#
public void Append(SoftArtisans.OfficeWriter.WordWriter.Document other)
vb.net
Public Sub Append(ByVal other As SoftArtisans.OfficeWriter.WordWriter.Document)
Parameters
other
Document object being appended to the current document.Remarks
This method works by adding all of the Sections of the appended document to the current document; if a the current document has 3 sections and the appended document has 4 sections, the resulting document will have 7 sections. Because sections are preserved, headers, footers, and all other section formatting from both documents are also preserved.Examples
C#
//--- Open first document
Document doc1 = wa.Open(Page.MapPath("documents/first document.doc"));
//--- Open second document
Document doc2 = wa.Open(Page.MapPath("documents/second document.doc"));
//--- Append second document to the first
doc1.Append(doc2);
//--- Save the resulting document and stream to customer
wa.Save(doc1, Page.Response, "output.doc", false);
vb.net
'--- Open first document
Dim doc1 As Document = wa.Open(Page.MapPath("documents/first document.doc"))
'--- Open second document
Dim doc2 As Document = wa.Open(Page.MapPath("documents/second document.doc"))
'--- Append second document to the first
doc1.Append(doc2)
'--- Save the resulting document and stream to customer
wa.Save(doc1, Page.Response, "output.doc", false)
