Wednesday, 17 October 2012

Opening Word File in Website

 

Opening Word File in Website

Here is the Code for Opening/Saving a Word Document via a Web Application..

It will open a dialog box for opening the Word Document on Button Click Event..


    protected void Button1_Click(object sender, EventArgs e)

    {

       Response.Clear();

       Response.ContentType = "application/ms-word";

       Response.AddHeader("Content-disposition", "inline;filename=abc.docx");

       String path = Server.MapPath("abc.docx");

       Response.WriteFile(path);

       Response.End();

    }

No comments:

Post a Comment

Thank You for Your Comments. We will get back to you soon.

back to top