Aug 8, 2016

Tips: Open Office Document Online (Web Version) in SharePoint

In SharePoint, there are 2 ways of setting a link to an Office Document. The most common way we’ve always seen is by direct link, which will download the Office document to your local storage.

Now, there’s another way to link to an Office document and force it to open in Online viewer such as Excel Online, PowerPoint Online, or Word Online. The most possible way is to copy the URL by clicking on the ellipsis next to the filename.

image

Now, you’ll see something similar to this, which will force-open the file in Excel Online:
https://www.contoso.com/Shared%20Documents/Essential%20Regulatory%20Documents%20Inventory%20List%20Template.xlsx?d=we035ad79215c4e82ba32d989b66bacfd

Or at any point of time if you know the direct URL to the file but unsure what is the number or code next to d=, you can just put the link as below.

https://www.contoso.com/Shared%20Documents/Essential%20Regulatory%20Documents%20Inventory%20List%20Template.xlsx?web=1

This way, it will forcefully open the excel (or essentially any Office document) in Online Viewer.

 

WAIT, there’s more! I know that you’re going to complain!

How are you going to embed the document onto the page with IFRAME without having Excel Online bar like the one below?

image

To fix this, now you need to open the URL in new tab, and you should see the URL transformed into this format below.

https://www.contoso.com/_layouts/15/WopiFrame.aspx?sourcedoc={e035ad79-215c-4e82-ba32-d989b66bacfd}&action=view

Pay attention to the red one, you can change that from view to embedview.

image

You can also add another option such as to hide gridlines for a cleaner look (wdHideGridlines=True).

https://www.contoso.com/_layouts/15/WopiFrame.aspx?sourcedoc={e035ad79-215c-4e82-ba32-d989b66bacfd}&action=embedview&wdHideGridlines=true

image

Or you can hide the row headers (wdHideHeaders=True).

https://www.contoso.com/_layouts/15/WopiFrame.aspx?sourcedoc={e035ad79-215c-4e82-ba32-d989b66bacfd}&action=embedview&wdHideGridlines=true&wdHideHeaders=true

image

You can explore more options in Embed Excel Workbook on your webpage or Embed Presentation on your webpage. Winking smile