Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IFrame and Word Documents 1

Status
Not open for further replies.

aspmonster

IS-IT--Management
Dec 11, 2003
25
US
I am trying to make a documentation section on my website.
I will be listing my collection of documents on the left side of the page. I want the specific document(Word Doc) to be displayed on the right side within an IFrame.
Is this possible.
Please give some ideas or some example from where I can use some code.
Thanks.
RM
 
RM,

I don't have code handy to do this, but here are a few pointers and tips:

- You can probably do this simply by setting the SRC of the IFRAME to be that of the Word document (
Code:
<IFRAME SRC=&quot;myWordDoc.doc&quot;></IFRAME>
)

- It probably wouldn't work if the user doesn't have Word installed on their local PC.

Hope these help!

Dan
 
Thanks Dan,
But how will the IFRAME change in the same when I click on the left panel(the links).
 
RM

In your right frame, have something like:

Code:
<IFRAME SRC=&quot;&quot; ID=&quot;docPreviewFrame&quot;></IFRAME>

And in your left frame, have something like:

Code:
<A HREF=&quot;javascript:parent.rightFrameName.document.getElementById('docPreviewFrame').src = 'wordDoc1.doc';&quot;>Document 1</A>
<BR>
<A HREF=&quot;javascript:parent.rightFrameName.document.getElementById('docPreviewFrame').src = 'wordDoc2.doc';&quot;>Document 2</A>
<BR>
<A HREF=&quot;javascript:parent.rightFrameName.document.getElementById('docPreviewFrame').src = 'wordDoc3.doc';&quot;>Document 3</A>

I think that should do the job...

Hope this helps!

Dan
 
I think as the elements are not defined..its giving me some script error like &quot;parent.rightFrameName&quot; is not null or something like that.
Please help..whats going wrong here..
I can mail u my html to check if u could..
Thanks,
RM
Happy Holidays
 
You need to replace &quot;parent.rightFrameName&quot; with the correct path to the right frame from the left.

If you post your frameset definition code, I can probably tell you what it should be.

Dan
 
This is my left navigation panel
------------------------------
<UL>
<LI><A href=&quot; Request</A>
<LI><A href=&quot; Reads</A>
<LI><A href=&quot; &amp;
Payment Support</A>
------------------------------

Right Display section
------------------------------
<TABLE cellSpacing=0 cellPadding=0 width=407 border=0>
<TBODY>
<TR>
<TD>View Content Below<TD></TR>
<TR>
<TD><IMG height=13 src=&quot;home_files/spacer.gif&quot;
width=13></TD></TR>
<TR>
<TD>
<IFRAME SRC=&quot;&quot; ID=&quot;docPreviewFrame&quot;></IFRAME>
</TD></TR>
</TBODY></TABLE>
------------------------------

Also is there any way to specify IFRAME Size. For example if if I want to display a Word Doc(in an IFRAME) in its full size in a new window..is it possible...
Please help.
 

RM,

That code doesn't really help - you need to post your complete FRAMESET definition to show what the path from the left frame to the right frame might be.

Dan
 
I am not using any frames.
I just want to display documents based on the left side navigation panel either on the same page on the right side or on a popup window of 750(height) 825(width).
I think I might have confused you..I am sorry...I wasnt just getting the right idea..
Hope you can still help me..
Thanks,
RM
 
Aaah sorry - that was my mistake. When you said your navigation was in the left panel, I assumed you were talking about a left-hand frame.

If your links are on the same page as your IFRAME, then the following code should work:

Code:
<A HREF=&quot;javascript:document.getElementById('docPreviewFrame').src = 'wordDoc1.doc';&quot;>Document 1</A>
<A HREF=&quot;javascript:document.getElementById('docPreviewFrame').src = 'wordDoc2.doc';&quot;>Document 2</A>
<A HREF=&quot;javascript:document.getElementById('docPreviewFrame').src = 'wordDoc3.doc';&quot;>Document 3</A>

...

<TD>
	<IFRAME SRC=&quot;&quot; ID=&quot;docPreviewFrame&quot; STYLE=&quot;width:825px;height:750px;&quot;></IFRAME>
</TD>

You can place the IFRAME whereever you like, including in your table cell. You can change the width and height by modifying the style attribute attached to it.

Hope this helps!

Dan


 
I will sure give this a try..and will keep u posted how it goes..
Thanks Dan.
 
Dan,
Sorry didn't get it running.
Is there an Email Id where I can send the code to u..maybe u can take a look at it..and check whats going wrong.
Thanks
RM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top