I need the following requirement.
The user should be able to view and edit the doc,xls,ppt etc file in the browser .
These files should not open with application,mean to say that i should not get "open with dialog box
I have put my efforts and find the solution to display pdf,jpg formatted files in the browser when the user clicks on some link.
I am also able to display the MSword file in the browser which contains text only and also without formatting ,unable to display the images,tables of Msdocument in the browsers.
I am giving my efforts below.
If anyone could help i will be very thankful to them
Thanks in Advance
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Office.Interop.Word;
using Microsoft.Office.Interop;
using Microsoft.Office;
public partial class MSWord_Display : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Params.Count > 0)
{
if (Convert.ToString(Request["word"]).Length > 0)
{
string name = @"D:\prasad\working Folder\sandhya_1.doc";
ApplicationClass oWordApp = new ApplicationClass();
object fileName = name;
object readOnly = true;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
Document oWordDoc = oWordApp.Documents.Open(
ref fileName,
ref missing, ref readOnly,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref isVisible,
ref missing, ref missing, ref missing, ref missing);
oWordDoc.Activate();
txtArea.InnerHtml = oWordDoc.Content.Text;
}
else
{
divMsword.InnerHtml = "<b> Document name is missing: </b>";
}
}
}
}