p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > HTML > HTML Code Clinic
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 17th, 2009, 10:39 AM
Authorized User
Points: 116, Level: 2
Points: 116, Level: 2 Points: 116, Level: 2 Points: 116, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: Tehran, Tehran, Iran.
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to embed Word document in HTML page!

Hi everybody

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:

<html>
<body>
<object id="msword" width="100%" height="100%"
classid="CLSID:00020906-0000-0000-C000-000000000046"
data='http://localhost/testword/test.doc'>
</object>
</body>
</html>

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
__________________
Ehsan Zaery Moghaddam
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
export asp.net page to ms word and embed images Itech ASP.NET 2.0 Professional 0 January 11th, 2008 05:59 PM
Converting Word Document into HTML using jsp gharikishore9 Pro JSP 1 July 1st, 2006 08:25 PM
problem in word document converts to html or aspx yoord BOOK: Beginning ASP.NET 1.0 0 October 11th, 2004 07:08 AM
How show Word Document in One of the Frames page Umashankar R VB.NET 2002/2003 Basics 1 September 12th, 2004 10:36 PM
embed images in html allang Pro JSP 0 August 22nd, 2004 10:43 PM



All times are GMT -4. The time now is 02:15 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc