You are here:
< Back

Embedding O365 documents

First, you need to obtain a shared URL for your document.

  • Go into your OneDrive account and click the share button on your file.

  • Then click the “copy URL” button.

Now you have your document’s shared URL, which you can embed using our custom element.

Select the “URL” as the content type, and paste the shared URL from the previous step as the URL, and add “&action=embedview” to the end of the URL.

Your URL should look something like this:

https://tenant-my.sharepoint.com/:p:/g/personal/teanant/EWg5asd4BuNi1yTWihPWB5a7F3wmsUw?e=9Bndf1&action=embedview

You can also enable Interactivity, to make your element interactive (ability to scroll in the document, change pages in a presentation).

This method will work for EXCEL, PPT, and WORD files.

For EXCEL files you can use these query params to perform different actions:

wdHideSheetTabs=True  : Hides the sheet tabs that are displayed at the bottom of all sheets in a workbook.

wdAllowInteractivity=True  :  Lets you interact with the data if your workbook has a table or PivotTable that can be sorted and filtered.

Item=itemName   :  Displays a specific item. If your workbook includes a chart, table, PivotTable, or named range, and you want to display only one of the items in your web page, use the Item parameter to specify that item. For information about named ranges and named items in Excel workbooks.

ActiveCell=CellName  :  Specifies the active (selected) cell in the embedded workbook when the web page opens. You can specify the active cell by cell reference (such as A1) or by name.

wdHideGridlines=True   :  Hides worksheet gridlines for a cleaner look.

wdHideHeaders=True  :  Hides the column and row headers.

wdDownloadButton=True   :    Includes the Download button so viewers can download their own copy of the workbook.

Add the query param to the end of the URL after the &action=embedview, like: &wdHideSheetTabs=True.

 

Embedding Google documents

  • To embed Google documents simply open the document and select “publish to the web” in the “file” menu.

  • Then go to the “embed” tab click publish, and copy the URL.

Now you have your document’s shared URL, which you can embed using our custom element.

Select the “URL” as the content type, and paste the shared URL from the previous step as the URL.

Your URL should look something like this:

https://docs.google.com/spreadsheets/d/e/2PACX-1vTHb75CliYAhjj_jlcTMSoUC0ocmZgHWSxT_/pubhtml?widget=true&amp;headers=false

You can also enable Interactivity, to make your element interactive (ability to scroll in the document, change pages in a presentation).

For Google Spreadsheets you can use these query params to perform different actions:

gid={{gid_id}}  :  Display a specific sheet with it’s sheet ID.

gridlines=false / true  :  To display gridlines.

sheetnames=true / false  :  To display sheet names.

Add the query param to the end of the URL after the ?widget=true&amp;headers=false, like: &gridlines=false.