Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
ODF .NET
>
Tutorial
> Append document
The example shows you how to append content of one document to content of another document.
C# example
using System; using Independentsoft.Odf; namespace Sample { class Program { static void Main(string[] args) { TextDocument first = new TextDocument("c:\\first.odt"); TextDocument second = new TextDocument("c:\\second.odt"); foreach (ITextContent bodyElement in second.Body.Content) { first.Body.Add(bodyElement); } first.Save("c:\\test.odt"); } } }
VB example
Imports System Imports Independentsoft.Odf Module Module1 Sub Main(ByVal args() As String) Dim first As New TextDocument("c:\first.odt") Dim second As New TextDocument("c:\second.odt") For Each bodyElement As ITextContent In second.Body.Content first.Body.Add(bodyElement) Next first.Save("c:\test.odt") End Sub End Module