Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

JS embedding

trying to insert word docs into a html page



1:51 pm on Jul 17, 2003 (gmt 0)

10+ Year Member

hi all,

im trying to insert multiple word docs into a html page depending on form submitting . im presuming each doc needs an <object>, or <embed> tag..

im submitting a page, then with JS in the onsubmit of the form i do ..

//set some vars with submitted values
html = these values..;
//was trying this..
document.writeln("<embed src='xxx.doc'>")

i know the embed tag is wrong, but also must i writeln the <html><body... bits in order for the page to show any embedded things?
strange to do with JS i know, but lets not go into that..

any help much appreciated ..



5:48 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

hi natty,

you have to write head and body part with open. but nevertheless for testing purposes for your object tags, this should not be necessary in my opinion.

the rest of the code (just not the embed as you pointed out) looks quite right ;).

- hakre


6:40 pm on Jul 17, 2003 (gmt 0)

10+ Year Member

anyone know the correct way to embed a word doc in html by any chance, ive searched and searched on google, but dont have frontpage.. :-p


7:11 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

this is a first info i found in my research:

ActiveX Documents are embeddable OLE objects that behave more like ActiveX controls than traditional OLE objects. Unlike a normal embedded object, an ActiveX Document is not designed to be a contained object in a larger document. Instead, it is considered a complete document in itself, which is merely being viewed by a viewer (such as Internet Explorer) or is being collected into a single resource with other documents (such as a Binder file).

first of all, you website will only work on windows based systems - no unix, no apple (not even with ie there, in my knowledge, ms cancelled activex integration in mac ie, correct me if wrong).

internet explorer itself is able to open activex documents and - i forgot to wrote it first - a word document can be displayed as activex document like almost any ms office file (.xls, .ppt).

if i follow ms specs, an iframe with an src= attribute with the doc's filename as value should do the trick. feel free to check it out.

- hakre


1:09 pm on Aug 6, 2003 (gmt 0)

hakre would you be kind enough as to copy the code need to embedd a word doc into an IE window! Or any one else if you know!


9:22 pm on Aug 6, 2003 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Word files as web documents. What a horrible messy thought. I don't like that idea at all.

Even PDF files would be more universally compatible than doing that (and a lot easier to set up).


11:30 pm on Aug 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

This supposedly works, but I have no idea if it does. If so I imagine it only works in IE.


var pause = 0;
var wdDialogFileOpen = 80;
var wdApp = new ActiveXObject("Word.Application");
var dialog = wdApp.Dialogs(wdDialogFileOpen);
var button = dialog.Show(pause);



Featured Threads

Hot Threads This Week

Hot Threads This Month