html content into docx file
<p>I am taking data from <code>stringBuilder</code> and putting it into .docx file. For .doc extension we can do using <code>stringBuilder</code> directly. But for .docx file there is a problem.</p>

<p>Like this. But its corrupting the .docx file.</p>

<pre><code>strBuilder.Append("".ToString()); strBuilder.Append("".ToString()); 
strBuilder.Append("SI.No ".ToString()); strBuilder.Append("&lt;\table&gt;");

FileStream stream = File.Open(@"D:\wordfile3.DOCX", FileMode.Create);

System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();

byte[] binaryData = encoding.GetBytes(strBuilder.ToString());

for (int i = 0; i &lt; binaryData.Length; i++)
{
    stream.WriteByte(binaryData[i]);
}

stream.Flush();
stream.Close();
</code></pre>
