Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
Word .NET
>
Tutorial
> Display text
The example shows you how to open a document and display document's content as plain text.
C# example
using System; using Independentsoft.Office; using Independentsoft.Office.Word; namespace Sample { class Program { static void Main(string[] args) { WordDocument doc = new WordDocument("c:\\test.docx"); string text = doc.ToText(); Console.WriteLine(text); Console.Read(); } } }
VB example
Imports System Imports Independentsoft.Office Imports Independentsoft.Office.Word Module Module1 Sub Main(ByVal args As String()) Dim doc As WordDocument = New WordDocument("c:\test.docx") Dim text As String = doc.ToText() Console.WriteLine(Text) Console.Read() End Sub End Module