Office Web Apps Viewer and Google Drive Viewer can come handy when you don't have any Office suite installed on your computer or when you would like to quickly preview any online Office file in the browser without having to download it locally.
https://www.labnol.org/files/word.docx [Word document]https://www.labnol.org/files/excel.xlsx [Excel spreadsheet]
Google Drive Viewer
Google Drive includes a built-in viewer feature that allows you to view Office files directly in the browser without downloading them. The files are streamed from the hosting website and not uploaded to your Google Drive either.
To view the file, replace FILE_URL with the link of the file you want to view
https://drive.google.com/viewer?url=FILE_URL
If you would like to embed an Office file in your website with the Google Drive viewer, the HTMl would be as below. You would need to replace the actual URL of the document and may also adjust the height and width attributes of the IFRAME tag.
<iframe
src="https://drive.google.com/viewer?embedded=true&hl=en-US&url=FILE_URL"
width="500px"
height="350px"
frameborder="0"
></iframe>
Microsoft Office Viewer
Similar to Google Drive Viewer, Microsoft Office also offers a online document viewer to help you to view Word documents, Excel Spreadsheets and PowerPoint decks directly in the browser without downloading them.
Simply replace FILE_URL with the URL of the Office file.
https://view.officeapps.live.com/op/view.aspx?src=FILE_URL
In addition to previewing Office files, the Office Web Apps Viewer tool can also be used for embedding Microsoft Office documents into your website or blog. The embed code would be something like this:
<iframe
src="https://view.officeapps.live.com/op/embed.aspx?src=FILE_URL"
width="500px"
height="350px"
frameborder="0"
></iframe>
While Office Web Apps viewer is definitely a better option that Google Docs Viewer, a limitation is that it only works with Office Files, Google Drive Viewer can also handle PDFs, Photoshop files and even AutoCAD drawings.

No comments:
Post a Comment