I Have to display a word document in my webpage. Our web application is running under trusted security policy with full permissions (on an intranet). All browsers are IE. There is a way (as I knew) using OBJECT tag. I know how to use this tag to include external objects on my HTML page (like SWF, PDF, etc). But it seems it doesn't work for Word documents. I'm trying the following code (simplified here) on different clients having Office 2003 or 2007 installed, using doc/docx file type:
<object id="msword" width="100%" height="100%"
When I open this page on my browser, it loads successfully without any error. But nothing appears on screen. It seems that Word object is loaded by browser (I can see WINWORD.exe on my process list using Task Manager) and fills the given area on the screen. I mean, when I right-click on different regions of my page, all the regions occupied by word object, prevents browser context menu to appear. Also the given file is downloaded from server successfully (as I changed the file address to some invalid name, a red cross apeared in place of Word object, indicating 404 HTTP error).
Some guys suggest to use IFRAME instead of OBJECT tag and set its src to given doc file. But in this scenario, browser tries to save/open given file and save/open dialogue appears on screen.
Now, I don't know what should I do and what to try.
- Is it possible to display a word document in HTML page in this way or it's completely impossile due to some technical issues ?
For example, Word OLE mechanism may not support to be hosted on a container like IE. This is my guess because when I try to open a pdf document using browser's file open dialogue, IE loads Adobe Acrobat Reader inside itself through OLE mechanism and let it handle displaying pdf file by itself. But when I try the same for a doc/docx file, file save/open dialogue appears and browser tries to download and save/open the given document.
- Do I have to try some special attributes on my OBJECT tag ?
I've already tried type attribute with different mime-type values I'd found for doc/docx document, but nothing happened
- Should I set some special mime-type on my server so that IE knows what is coming from server side?
As IE uses client's windows registery to lookup clsid of Microsoft Word, I think it's reading a mime-type associated to this clsid too.
However, I'm waiting for you guys. Please help me or tell me that it's completely impossible and make me relax