embed word file into iFrame

I'm trying to embed a word document in an iFrame. Not to edit only view, so I thought you could just put in the src parameter, but it just opens up in word itstead.

<!doctype html>

<html lang="en">
  <meta charset="utf-8">

  <title>Word iFrame Test</title>

  Below is a preview of a word file:-
  <iframe src="War and Peace.docx" height="300px" width="300px">


Open in new window

Can anyone advise the correct way of embedding a word document inside an iFrame? Even a PDF file..
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontyWeb Ninja at largeCommented:
i believe this is controlled by the browser settings. You'll need to either convert it to html or use a 3rd party control to view it
tonelm54Author Commented:
After a bit of reading Ive found you need to use an object then embed:-
		<object src="WarPeace.docx">
			<embed src="WarPeace.docx" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />

Open in new window

tonelm54Author Commented:
However putting it as an object doesnt seem to work:-
<object src="WarPeace.docx">
	<embed src="WarPeace.docx" />

Open in new window

The best practice for this sort of thing is to save the word doc as HTML and use that to go to the page.  Otherwise you are going to spend a lot of time spinning your wheels.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.