View Office Document

Last modified by Vincent Massol on 2021/03/18 11:29

cogView MS Office and Open Office documents in a page
TypeSnippet
Category
Developed by

Guillaume Lerouge

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

There's now a new and much better Office Macro that should be used instead.

To use:

  • Save your Office document as HTML
  • Attach it to a XWiki page
  • Use the code below to display the attached Office document inline

Code

<iframe src="/xwiki/bin/download/documentname.doc" width="100%" height="700px"
optional: frameborder=0 scrolling=0> </iframe>

In the following example we have bundled a Powerpoint presentation saved as HTML in a Zip file and attached the Zip to this page. Since the Zip Explorer plugin is activated on XWiki.org you can get the document that starts the presentation within the Zip.

#set ($url = $xwiki.zipexplorer.getFileLink($doc, "WikiWedPresentation.zip", "XWikiWedPresentation.html"))
<iframe src="$url" frameborder=0 width=800px height=600px></iframe>

The latter example in XWiki 2.0/2.1 Syntax looks like this:

{{velocity}}
{{html clean="false"}}
#set ($url = $xwiki.zipexplorer.getFileLink($doc, "WikiWedPresentation.zip", "XWikiWedPresentation.html"))
<iframe src="$url" frameborder=0 width=800px height=600px></iframe>
{{/html}}
{{/velocity}}

Result

Get Connected