\documentclass{article}
\usepackage{ulem}
\pagestyle{headings}
\begin{document}
Note: this is Apache-centric but read on at the end for a a potential IIS solution\newline
Note: works only with horde 3 \newline
\textsl{\textbf{For Apache:}}\newline
The wvHtml component of wvWare 1\footnote{http://wvware.sf.net} can be used to generate HTML renderings of Microsoft Word documents.  If wvHtml is installed, and Horde is configured to use it to view Word Documents, the msword MIME Viewer class will be invoked to generate the converted HTML document.  Any embedded contents of the Word Document, specifically graphics, will be placed in the upload\_tmp\_dir location, as configured in your php.ini, OR, if you have defined tmpdir in horde/conf.php, that value will be used.

However, the MIME viewer class for msword returns a web page that includes image links that point to the Horde webroot.  A solution some people have used is to modify the Horde or IMP code to actually write the graphics files to those locations, but this has security implications.

A more secure solution, which requires no modification to Horde, or IMP, is to leverage the Apache mod\_rewrite module to rewrite wvHtml graphics links on the fly and redirect them to your temporary directory.

To do this, you must obviously have Apache installed, and the mod\_rewrite module installed and enabled for your Horde installation (see the Apache mod\_rewrite documentation for configuration information2\footnote{http://httpd.apache.org/docs-2.0/mod/mod\_rewrite.html})

\renewcommand{\labelenumi}{\arabic{enumi}}
\begin{enumerate}
\item{Figure out your upload\_tmp\_dir value (referred to as \$tmpdir from here on out)}
\begin{itemize}
\item{If using the default PHP value, this is usually /tmp.}
\item{If you have set 'tmpdir' in horde/conf.php, use this value instead.}
\item{\textbf{Regardless, this directory should NOT be located underneath your Apache Raw: DocumentRoot}}
\end{itemize}
\item{Make sure you have horde/mime\_drivers.php configured to use wvHtml for msword documents}
\item{Add a Raw: RewriteRule to your Apache configuration }
\begin{itemize}
\item{\texttt{Raw: RewriteRule \^\$webroot/imp/msword(.+) \$tmpdir/msword\$1 [L]}}
\end{itemize}
\item{Restart Apache}
\item{View Word documents with graphics, in all their glory :)}
\end{enumerate}
As an example:

If:\newline
Horde configurations:

\begin{itemize}
\item{\texttt{\$conf['tmpdir']=/var/www/tmp} (\$tmpdir=/var/www/tmp)}
\item{\texttt{\$registry['webroot']['horde']= /horde} (\$webroot=/horde)}
\end{itemize}
Apache configuration:

\begin{itemize}
\item{\texttt{Raw: DocumentRoot  "/var/www/virtualdomains/yourdomain/horde"}}
\end{itemize}
Then your Raw: RewriteRule for Apache becomes:\newline
\texttt{Raw: RewriteRule \^/horde/imp/msword(.+) /var/www/tmp/msword\$1 [L]}

[\# IIS ]\newline
\textsl{\textbf{For IIS:}}\newline
Rewriting functionality in a default configuration of IIS is limited.  However, similar functionality should be attainable by using ISAPI\_rewrite3\footnote{http://www.isapirewrite.com}.  A lite version is available for free and the above syntax should work, although this author has not tested a configuration with IIS.

KMM

\end{document}
