Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Introducedin
4.1.0.1494
4.1.0.1494
Description

Excerpt

Appends an existing Document to the end of the current Document, separated by a next-page section break

Signature
C#
C#
public void Append(SoftArtisans.OfficeWriter.WordWriter.Document other)
Signature
vb.net
vb.net
Public Sub Append(ByVal other As SoftArtisans.OfficeWriter.WordWriter.Document)
Parameters
Param
other
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.

Example
Code Block
csharp
csharp
titleC#
        //--- 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);
Code Block
vb.net
vb.net
titlevb.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)