Word Document SaveAs2 in Format wdFormatDocument97
<p>I'm using Microsoft Interop Word version 15.0.0.0 in order to create a new Word document, insert some text into it, and save it.</p>

<p>When I'm saving it using the following command:</p>

<pre><code>document.SaveAs2(wordFilePath);
</code></pre>

<p>the document is saved in format DOCX.</p>

<p>But when I'm saving it using the following command:</p>

<pre><code>document.SaveAs2(wordFilePath, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument97);
</code></pre>

<p>the document is seemingly saved as Word-97 DOC (Windows explorer display it with Word-97 DOC icon and type), but it is really internally saved as DOCX (I can see this in two ways: it has the same size of the corresponding DOCX, and when I open it with Word-2016 and select SaveAs, the default save format is DOCX!).</p>

<p>How can I save a document in real document-97 format?</p>

<p>Here's the function used to create a new Word document, whose type depends on the extension (DOC vs. DOCX) of given file path:</p>

<pre><code>public static void TextToMsWordDocument(string body, string wordFilePath)
{
    Microsoft.Office.Interop.Word.Application winword = new Microsoft.Office.Interop.Word.Application();
    winword.Visible = false;
    object missing = System.Reflection.Missing.Value;
    Microsoft.Office.Interop.Word.Document document = winword.Documents.Add(ref missing, ref missing, ref missing, ref missing);
    if (body != null)
    {
        document.Content.SetRange(0, 0);
        document.Content.Text = (body + System.Environment.NewLine);
    }
    if (System.IO.Path.GetExtension(wordFilePath).ToLower() == "doc")
        document.SaveAs2(wordFilePath, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument97);
    else // Assuming a "docx" extension:
        document.SaveAs2(wordFilePath);
    document.Close(ref missing, ref missing, ref missing);
    document = null;
    winword.Quit(ref missing, ref missing, ref missing);
    winword = null;
}
</code></pre>

<p>And here's the code used to call this function:</p>

<pre><code>TextToMsWordDocument("abcdefghijklmnopqrstuvwxyz", "text.doc");
TextToMsWordDocument("abcdefghijklmnopqrstuvwxyz", "text.docx");
</code></pre>