

Embed Office Documents On Your Site
source link: https://cwestblog.com/2020/05/22/embed-office-documents-on-your-site/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Have you ever wanted to display an Excel workbook or a Word document on your website? Of course, it is possible to save files as HTML but it just doesn’t have the same feel. Fortunately Microsoft can actually come to the rescue. For example I have this sample spreadsheet that I created and then uploaded to my own website:
http://cwestblog.com/wp-content/uploads/2020/05/Fake-People-1.xlsx
Even though the file is hosted here I can still view the contents in an IFRAME
by using the following URL:
https://view.officeapps.live.com/op/embed.aspx?src=http://cwestblog.com/wp-content/uploads/2020/05/Fake-People-1.xlsx
Here is the resulting IFRAME
:
Believe it or not it is that simple to embed an office document on a webpage. If you want to do this you can simply use https://view.officeapps.live.com/op/embed.aspx?src=
and append the URL to your Office document so that it is passed as the src
parameter. There are additional parameters that you can define if you want. To find these options you can use the option in the bottom-right corner to view in full-size mode and then in the main menu select File
» Share
» Embed
.
Embed Full View
It is also possible to either link to the full view which includes the menus. To do this instead of the path to their service being …embed.aspx?src=…
you can use …view.aspx?src=…
. Here is an example of the link and the corresponding IFRAME
:
https://view.officeapps.live.com/op/view.aspx?src=http://cwestblog.com/wp-content/uploads/2020/05/Fake-People-1.xlsx
Embed PowerPoint Presentations
Being able to embed Word documents and Excel spreadsheets is great, but being able to also embed PowerPoint presentations is even cooler:
https://view.officeapps.live.com/op/embed.aspx?src=http://cwestblog.com/wp-content/uploads/2020/05/Example-Presentation.xlsx
Final Words
There are probably other free APIs out there that provide the same functionality so if you know of one let us know in the comments below. As always, happy coding!
Recommend
-
11
UnitePDF - Convert PDF, Office documents and Images for free - NEXT
-
38
rga is a line-oriented search tool that allows you to look for a regex in a multitude of file types. rga wraps the awesome ripgrep and enables it to search in pdf, docx, sqlite, jpg, zip, tar.\*, movie subtitles (mkv, mp4), etc. github repo Linu...
-
13
Generate office documents with DjangoGenerate office documents with Django Fri 13 September 2013In our recent Django projects, we had to create documents (Libre/OpenOffice, Microsoft Office, PDF...), and therefore created two compone...
-
5
TL;DR An Office XML (.xml) document can call a remote XSL stylesheet over SMB. If this occurs against an attacker controlled server, the net-NTLM authentication hash (challenge/response) of that user is revealed. Operationally, an...
-
15
.Net Standard 2.0 create Microsoft Office documents in Xamarin Forms We had to wait a while for it to happen, but it’s finally here; .Net Standard 2.0 support in Xamarin Forms. This is a big step in sharing .net code across mul...
-
9
Office for iOS will soon let you listen to documents when the screen is locked
-
9
Google Docs will soon let you embed other apps into your documentsGoogle Docs will soon let you embed other apps into your documents / It’s taking on Notion, Coda, and the other apps that turn your documents...
-
3
Home
-
6
Why Documents Found at Biden Office Differ From Trump Mar-a-Lago Docs US Markets Loading... In...
-
4
Microsoft announces Copilot: the AI-powered future of Office documents / Copilot is a modern AI assistant that will help Microsoft 365 users create Office documents. Mar 16, 2023, 3:06 PM UT...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK