Open word document inside frame?
I have two frames one at the top and one at the bottom.
I am using the following to load a document into the bottom frame and this code works fine for PDF documents and they load into the frame fine.
BUT for ms word documents the document always opens outside the frame in a new window. How can I force the MS Word document to load inside the bottom frame?
parent.frames.myFrame.navigate('file://myMachine/temp/events.doc')
[460 byte] By [
ShazadAli] at [2007-11-19 19:18:58]

# 1 Re: Open word document inside frame?
What browser are you using? Without messing up any config settings, I don't think that will work out of Internet Explorer (if it does in IE anymore at all ...). You could, for example, make a word file open in IE by default, and then it would work in IE, if it doesn't already, but I don't think that is a reasonable solution.
# 2 Re: Open word document inside frame?
I'm using IE6 and it works fine for PDF's. i.e the pdf loads in the lower frame as instructed. i.e.
parent.frames.myFrame.navigate('file://myMachine/temp/events.pdf')
but word docs just always open outside the frame in its own window!
Ive also tried
parent.frames.myFrame.location = 'file://myMachine/temp/events.doc'
and
parent.frames.myFrame.location.replace('file://myMachine/temp/events.doc')
all do the same.
# 3 Re: Open word document inside frame?
How are you calling this (from what is the code being executed).
I think it should work if you give the iframe a name, and then give the link a target of the same name:
<iframe ... name="myFrame" ... >
<a ... target="myFrame" ... > ... </a>
I'm not sure that is applicable to your code though