using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using Microsoft.Office.Interop.Word; public partial class Articles : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Microsoft.Office.Interop.Word.Application objWordApp = new Microsoft.Office.Interop.Word.Application(); //ACCESSING THE WORD FILE PATH object objWordFile = Server.MapPath("Images\\water crisis.doc"); object objNull = System.Reflection.Missing.Value; Document WordDoc = objWordApp.Documents.Open( ref objWordFile, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull, ref objNull); WordDoc.ActiveWindow.Selection.WholeStory(); WordDoc.ActiveWindow.Selection.Copy(); string strWordText = WordDoc.Content.Text; WordDoc.Close(ref objNull, ref objNull, ref objNull); objWordApp.Quit(ref objNull, ref objNull, ref objNull); // Asssigning word file value to bind the div divfordisplaywordcontent.InnerHtml = strWordText; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)