3

I am looking for a way to embed Office Online editors in an iframe. I need https://portal.office.com/ as the src of the iframe, but that does not seem to work.

Then I thought I could maybe embed an empty document in there and have it be saved as a new file upon use. This does not seem to be possible however, as embedded documents are presented as read-only.

Does anybody know how to embed any of the Office Online editors in an iframe?

I've used this fiddle to tinker around in jsfiddle.net/n7e3wv6v/33

1
  • wopi.readthedocs.io/en/latest/index.html Take a look at the WOPI protocol (which is definitely not as simple as just embedding an iframe, but maybe it'll fit your needs). "You can use the Web Application Open Platform Interface (WOPI) protocol to integrate Office for the web with your application."
    – Splines
    Jan 16, 2021 at 22:28

1 Answer 1

1

Yes I think it can be done with the following code, src document must be public and a extension known by office (docx, xls ...) :

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=http://remote.url.tld/path/to/document.doc' width='1366px' height='623px' frameborder='0'>
This is an embedded
<a target='_blank' href='http://office.com'>Microsoft Office</a>
document, powered by
<a target='_blank' href='http://office.com/webapps'>Office Online</a>.

1
  • Hey, thanks a lot for your answer. However, it embeds a Microsoft page that is supposed to create links to embedded Office Online documents (for viewing, not editing). Here's the output I'm getting from that: jsfiddle.net/n7e3wv6v/45/ Jul 12, 2018 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.