Employers - Post Free Jobs
Forum guidelines
AuthorQuestion
Embed a word document inside IFrame/Aspx page
Posted on: 14 Sep 2013
Hi Everyone, I need a help. I want to display a word document inside an aspx page. Currently when i say response.contenttype=application/msword, its asking me to save/open file. But i want to embed this document into web page(say iframe). I dont want to use Interop Lib. And also i should be able to view both doc and docx format. Any pointers? Thanks in advance.
Thanks & Regards,
Santhosh

Please mark this answer as accepted answer if it resolves your problem.
AuthorReply
Re: Embed a word document inside IFrame/Aspx page
Posted on: 17 Sep 2013  
No it's not possible. You must convert the Doc to HTML format and load into html or .aspx file.
Mark as Answer, on the posts reply's that helped you !!!.
Re: Embed a word document inside IFrame/Aspx page
Posted on: 17 Sep 2013  
Suthish,

Any pointers to convert doc to html format?

Thanks & Regards,
Santhosh

Please mark this answer as accepted answer if it resolves your problem.
Re: Embed a word document inside IFrame/Aspx page
Posted on: 17 Sep 2013  

 Why don't just do a web search. Lots of samples available.

 Convert Microsoft Office Word to other formats (pdf, html, rtf, xps)

Mark as Answer, on the posts reply's that helped you !!!.
Re: Embed a word document inside IFrame/Aspx page
Posted on: 17 Sep 2013  
Using Interop i can do it. But i mentioned i want to do it without interop
Thanks & Regards,
Santhosh

Please mark this answer as accepted answer if it resolves your problem.
Re: Embed a word document inside IFrame/Aspx page
Posted on: 26 Sep 2013  
Hi, convert the doc(or docx) to html and load html file. Below is the detailed code:
using Spire.Doc;
using Spire.Doc.Documents;

namespace Word_to_HTML
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
//Create word document
Document document = new Document();
document.LoadFromFile(@"..\wordtohtml.doc");

//Save doc file to html
document.SaveToFile("toHTML.html", FileFormat.Html);
WordDocViewer("toHTML.html");
}

private void WordDocViewer(string fileName)
{
try
{
System.Diagnostics.Process.Start(fileName);
}
catch { }
}
}
}
refer to this article

Employers - Post Free Jobs

SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.