How to Convert Word to RTF

Why Convert Word to RTF?

Since 1990s, Microsoft began to use .doc extension for a range of their proprietary word processing formats. Doc format is usually associated with Microsoft Office applications. But storing text in Doc files is not always convenient, as they are not compatible with the majority of third-party text editors. To make Doc information more accessible, it is better to store it in other, more common format. And as a rule, users select RTF format, because it is supported by the wide range of applications.

How to Convert Word to RTF with Spire.Doc?

Spire.Doc can convert Word to RTF without Microsoft Office installed on your system. Download Spire.Doc (or Spire.Office) with .NET Framework 2.0 (or above) and follow the simple steps below to convert Word to RTF.

Step 1: Create a project through Visual Studio and add Spire.Doc DLL as reference.

Step 2: Load local Word doc file which we need to convert to RTF format. Use the code below to load Word file.

            Document document = new Document();
            document.LoadFromFile(@"D:\Sample.doc");

Step 3: Spire.Doc allows users to convert Word doc files to most of popular file formats including PDF, HTML, RTF, EPub, XML, Dot, Text, etc. The following code can help us convert Word to RTF.

document.SaveToFile("Sample.rtf", FileFormat.Rtf);

Step 4: Copy the full code below into the project and start the project by pressing F5.

Full Code:

[C#]
	private void button1_Click(object sender, EventArgs e)
	{
	    //Create word document
	    Document document = new Document();
	    document.LoadFromFile(@"D:\Sample.doc");

	    //Save doc file.
	    document.SaveToFile("Sample.rtf", FileFormat.Rtf);

	    //Launching the MS Word file.
	    WordDocViewer("Sample.rtf");
	}

	private void WordDocViewer(string fileName)
	{
	    try
	    {
	        System.Diagnostics.Process.Start(fileName);
	    }
	    catch { }
	}
   
[VB.NET]
	Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
	    'Create word document
	    Dim document_Renamed As New Document()
	    document_Renamed.LoadFromFile("D:\Sample.doc")

	    'Save doc file.
	    document_Renamed.SaveToFile("Sample.rtf", FileFormat.Rtf)

	    'Launching the MS Word file.
	    WordDocViewer("Sample.rtf")
	End Sub

	Private Sub WordDocViewer(ByVal fileName As String)
	    Try
	        Process.Start(fileName)
	    Catch
	    End Try
	End Sub        

Effective Screenshot:

Word to RTF