Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
ODF .NET
>
Tutorial
> Replace text
The example shows you how to open a text document and replace text.
C# example
using System; using Independentsoft.Odf; namespace Sample { class Program { static void Main(string[] args) { TextDocument doc = new TextDocument("c:\\test.odt"); doc.Replace("John Smith", "Mary Rose"); doc.Save("c:\\test2.odt"); } } }
VB example
Imports System Imports Independentsoft.Odf Module Module1 Sub Main(ByVal args() As String) Dim doc As New TextDocument("c:\test.odt") doc.Replace("John Smith", "Mary Rose") doc.Save("c:\test2.odt") End Sub End Module