Html editor - Remove tags
<p>I am having a html editor in my page . I want to store the text in word document with the styles like bold,italic etc.. Im using this code to write in word document..</p>

<pre><code>object strTextToWrite = txtdocument.Text.Trim();

        oWordApplic = new Word.ApplicationClass();
        object missing = System.Reflection.Missing.Value;
        oDoc = oWordApplic.Documents.Add(ref missing, ref missing, ref missing, ref missing);
        oDoc.Activate();
        string test = StripTagsCharArray(txtdocument.Text);        
        string test2 = test.Replace("&amp;nbsp;", " ");
        oWordApplic.Selection.TypeText(test2);
object path =Server.MapPath("~/Documents/"+txtfrom_name.Text + ".doc");
        oDoc.SaveAs(ref path, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
            ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
        oDoc.Close(ref missing, ref missing, ref missing);
        oWordApplic.Application.Quit(ref missing, ref missing, ref missing);
</code></pre>

<p>The split function is</p>

<pre><code>public static string StripTagsCharArray(string source)
    {
        char[] array = new char[source.Length];
        int arrayIndex = 0;
        bool inside = false;

        for (int i = 0; i &lt; source.Length; i++)
        {
            char let = source[i];
            if (let == '&lt;')
            {
                inside = true;
                continue;
            }
            if (let == '&gt;')
            {
                inside = false;
                continue;
            }
            if (!inside)
            {
                array[arrayIndex] = let;
                arrayIndex++;
            }
        }
        return new string(array, 0, arrayIndex);
    }
</code></pre>

<p>Now im getting the plain text without  bold,italic.. I need the bold,italic,underline functions in my word document ,,, Please help me</p>
