This is one of the common request you will get when you do any file operation in your project. This code can be used to open EXCEL, Power Point, PDF etc.
protected void btnWord_Click(object sender, EventArgs e)
{string strWordFile = @"c:/Test.docx";
FileInfo objDoc = new FileInfo(strWordFile);Response.Clear();
Response.ContentType = "Application/msword";Response.AddHeader("content-disposition", "attachment;filename=" + objDoc.Name);
Response.AddHeader("Content-Length", objDoc.Length.ToString()); Response.ContentType = "application/octet-stream";Response.TransmitFile(objDoc.FullName);
Response.End();
}