Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

Effortlessly convert Word documents to text files and vice versa with a few lines of C# code. Neither Microsoft Word nor interop dependencies are required when using the powerful Syncfusion .NET Word Library (DocIO).

Convert a Word document to a text file using C#

This example code shows how to convert a Word document into a text file using the Syncfusion .NET Word Library with just few lines of code in C#.

  1. using Syncfusion.DocIO;
  2. using Syncfusion.DocIO.DLS;
  3. //Load an existing Word document
  4. using FileStream inputStream = new FileStream("Template.docx", FileMode.Open, FileAccess.Read);
  5. using WordDocument document = new WordDocument(inputStream, FormatType.Docx);
  6. //Save the Word document as a text file
  7. using FileStream outputStream = new FileStream("Result.txt", FileMode.Create, FileAccess.Write);
  8. document.Save(outputStream, FormatType.Txt);
Syncfusion .NET Word Library Resources

Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.

Frequently Asked Questions

Yes, the Library supports Word file formats such as DOC, DOT, DOCX, DOTX, DOCM, DOTM, Word Processing 2007 XML, and RTF. Additionally, it can convert text into Markdown and HTML formats and vice versa.

Yes, the .NET Word Library supports retrieving the entire content of a Word document as a string without saving it as a text file.

Yes, the .NET Word Library supports batch conversion processes for text files to Word documents and vice versa.

Yes, you can convert text files to PDF and image formats using the .NET Word Library.

Yes, you can read the text file and insert it into a specific paragraph within a Word document programmatically.

You can access it through the Syncfusion.DocIO.Net.Core NuGet package. Detailed code samples are available in the documentation.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion® reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Want to create, View, and edit Word documents in C# or VB.NET?

Start a free 30-day evaluation today!
DOWNLOAD FREE TRIAL

No credit card required.

Mobile Free Evaluation Section

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.

Scroll up icon
Chat with us