How to Convert Word to Text

Why We Convert Word to Text?

Text is a format usually contains plain text or with minimum formatting. We can get benefits from Word to Text conversion:

  • Much smaller file size to save disk space
  • Compatible with almost all applications
  • Without or with minimum formatting and/or unusual characters

How to Convert Word to Text?

Spire.Doc is a MS Word component which enables user to perform a wide range of Word document processing tasks directly, such as generate, read, write and modify Word document for .NET and Silverlight. It supports converting files from Word Doc to Text, HTML, PDF, XML, RTF, Docx, Dot, etc.

Download Spire.Doc (or Spire.Office) with .NET Framework 2.0 (or above) together and follow the simple code below to convert Word to Text.

Step 1: Create a project in Visual Studio. Add Spire.Doc DLL as reference.

Step 2: Use the following code to load local Word docfile which you want to convert to Txt file.

            Document document = new Document();

Step 3: Save the word doc file as HTML by using the code below:

            document.SaveToFile("Sample.txt", FileFormat.Txt);

Step 4: Write the following full code into your project and press F5 to start it. Then, a Txt file will be automatically generated.

using System;
using System.Windows.Forms;
using Spire.Doc;
using Spire.Doc.Documents;

namespace tohtml_3
    public partial class Form1 : Form
        public Form1()

        private void button1_Click(object sender, EventArgs e)
            //Create word document
            Document document = new Document();

            //Save doc file.
            document.SaveToFile("Sample.txt", FileFormat.Txt);

            //Launching the MS Word file.

        private void WordDocViewer(string fileName)
            catch { }

Imports System
Imports System.Windows.Forms
Imports Spire.Doc
Imports Spire.Doc.Documents

Namespace tohtml_3
	Partial Public Class Form1
		Inherits Form
		Public Sub New()
		End Sub

		Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
			'Create word document
			Dim document As New Document()

			'Save doc file.
			document.SaveToFile("Sample.txt", FileFormat.Txt)

			'Launching the MS Word file.
		End Sub

		Private Sub WordDocViewer(ByVal fileName As String)
			End Try
		End Sub

	End Class
End Namespace

Effective Screenshot:

Word to Text