locked
use httpcontext in crm 2011 plugin RRS feed

  • Question

  • Hi,

    I am using the following httpcontext for making the word file of description of email entity. It works perfectly but disable the form after execution of the doc file.

    private void exporToWord(string subject, string html)
            {
                
                string strFileName = subject + ".doc";
                
                HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName);
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Charset = "";
    
                HttpContext.Current.Response.ContentType = "application/msword";
                StringBuilder strHTMLContent = new StringBuilder();
                strHTMLContent.Append(html);
                HttpContext.Current.Response.Write(strHTMLContent);
                //HttpContext.Current.Response.End();
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                HttpContext.Current.Response.Flush();
    
            }//End of exporToWord()

    Subject is the subject of the email activity and the html is the description of the activity.

    Please I want to seek your kind help in this regards.

    Thank You.

    Wednesday, February 19, 2014 11:06 AM