I get asked a bunch of questions around Office365 and Windows 10 and eventually I decide it’s probably worth explaining the “how to” answer in a blog post. One that has popped up consistently over the last year from time to time is:
How do I embed a Word, PowerPoint or Excel document that I have stored in OneDrive For Business or SharePoint into my blog / Learning Management / Intranet?
It’s a great question, because ideally we want to be able to work off a single document, stored in the cloud, that we can share publicly in a website context such as a blog or intranet, without needing to have duplicates of the file floating around. Because of security concerns, this is not a straight forward exercise in OneDrive For Business or SharePoint because, rightfully, many businesses want to restrict what is shared externally.
Interestingly, and somewhat frustratingly, it’s super easy to embed documents for anonymous viewing using the consumer OneDrive.com service e.g.
The process to achieve the same outcome in OneDrive For Business is slightly more complex, but it can be done and this is a good guide demonstrating how to achieve this using Excel Online as the example. For those desperate for a visual explanation, I’ve made a screencast showing how this can be done in just a couple of minutes:
If you want the step by step, then it’s basically:
- Go to your document hosted in OneDrive for Business and click the “share” button in the top right hand corner. When the “Share” box opens you need to ensure that the document is set to “Anyone with the link and view and edit” – you can turn off editing if you wish by expanding this drop-down menu. Then click “Copy Link”
- If your settings are correct you should get the green tick once you have hit copy:
- The KEY to get this working is to append the following to the URL you’ve copied from your document: &action=embedview
- An example (as below) would be: https://educationgate-my.sharepoint.com/personal/sam_mcneill_educationgate_school_nz/_layouts/15/guestaccess.aspx?docid=17df8114e248d4c9f81c7eff06710be76&authkey=AdPC1GSrfhkCu0gwlSSDzhQ&e=9c19b1955d804e2c8bf08149d149a227&action=embedview
- The above PowerPoint had some additional HTML wrapped around it to control the size of the iFrame as well e.g. width=”560″ height=”290″
- You can test your code at a website like this one by pasting the link you copied – don’t forget to include the “&action=embedview:
Below is the same Word Online document embedded into this blog post:
If you’re really keen to get stuck in with this, then do check out this link again which provides you with additional variables you can include e.g. ability to interact with an embedded Excel document,