TIP MsOfficeAttachmentsAsHTMLPlugin is not installed on Foswiki.org.


Changes attached DOC files into HTML files and then replaces the content of the topic with an include to the HTML source

Note: a version of this extension is available for use with TWiki. Please contact Foswiki:Main.CrawfordCurrie for details on how to retrieve it.


Attach a .doc file to a topic, and it will automatically generate a .html version of the attachment. If the topic text contains the magic setting:
then the topic content will automatically be replaced by an include of the (HTML) content of the attachment, using the following template:
  • Set REPLACEMENTNOTE = This text was automatically generated from the attachment $attachment
This site does not allow %INCLUDE% of URLs

Installation Instructions

This package requires a convertor that can convert from Word documents to HTML. Candidates are wvHtml and AbiWord

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Run configure and if necessary adjust the pathname to the convertor program.

There is one other important setting accessible through configure; $Foswiki::cfg{Plugins}{MsOfficeAttachmentsAsHTMLPlugin}{filters}. This is an array of (perl) regular expression substitutions that the generated HTML document is processed through. This allows you to rewrite sections of the HTML to remove Microsoft Word features. By default there is a single expression, which rewrites image links in the HTML to refer to the topic attachment directory.

Note that any Foswiki macros in the rewriting rules are expanded before the rule is applied. Be careful that the expansion of any such macros doesn't add new regular-expression meta-characters.


Author(s): Martin Cleaver Martin@Cleaver.org
Copyright: © 2003 Martin@Cleaver.org
© 2009 Crawford Currie http://c-dot.co.uk
License: GPL (Gnu General Public License)
Version: 3575 (2009-04-20)
Change History:  
20 Apr 2009 Foswikitask:Item8123: added URL rewriting
3 Feb 2009 Foswikitask:Item891: Ported to Foswiki, vastly simplified and enhanced, back-ported to TWiki (Crawford Currie)
Home page: http://foswiki.org/bin/view/Extensions/MsOfficeAttachmentsAsHTMLPlugin

PackageForm edit

ExtensionClassification Data and Files, Exporting, Printing and Publishing, Interface and Visualisation
ExtensionType PluginPackage
Compatibility Tested on Foswiki 1.0.0 and TWiki 4.2.3
DemoUrl http://
SupportUrl MsOfficeAttachmentsAsHTMLPlugin
ModificationPolicy PleaseFeelFreeToModify
Topic attachments
I Attachment Action Size Date Who Comment
MsOfficeAttachmentsAsHTMLPlugin.md5md5 MsOfficeAttachmentsAsHTMLPlugin.md5 manage 216 bytes 20 Apr 2009 - 14:53 CrawfordCurrie  
MsOfficeAttachmentsAsHTMLPlugin.sha1sha1 MsOfficeAttachmentsAsHTMLPlugin.sha1 manage 240 bytes 20 Apr 2009 - 14:53 CrawfordCurrie  
MsOfficeAttachmentsAsHTMLPlugin.tgztgz MsOfficeAttachmentsAsHTMLPlugin.tgz manage 4 K 20 Apr 2009 - 14:53 CrawfordCurrie  
MsOfficeAttachmentsAsHTMLPlugin.zipzip MsOfficeAttachmentsAsHTMLPlugin.zip manage 7 K 20 Apr 2009 - 14:52 CrawfordCurrie  
MsOfficeAttachmentsAsHTMLPlugin_TWiki.tgztgz MsOfficeAttachmentsAsHTMLPlugin_TWiki.tgz manage 4 K 14 Feb 2009 - 17:06 CrawfordCurrie TWiki build of latest plugin
MsOfficeAttachmentsAsHTMLPlugin_installerEXT MsOfficeAttachmentsAsHTMLPlugin_installer manage 4 K 20 Apr 2009 - 14:53 CrawfordCurrie  
Topic revision: r5 - 17 Aug 2009, CrawfordCurrie - This page was cached on 19 May 2017 - 11:00.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License