<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7232.11">
<TITLE>Implementing download to MS Word</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">I'm new to pmwiki, but I'd like to implement an action like 'print' that will output the proper headers so the page gets downloaded to MS Word. </FONT></P>
<P><FONT SIZE=2 FACE="Arial">I changed the print.php by adding:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">$HTTPHeaders = array(</FONT>
<BR><FONT SIZE=2 FACE="Arial"> "Expires: Tue, 01 Jan 2002 00:00:00 GMT",</FONT>
<BR><FONT SIZE=2 FACE="Arial"> "Cache-Control: no-store, no-cache, must-revalidate",</FONT>
<BR><FONT SIZE=2 FACE="Arial"> "Content-type: application/msword",</FONT>
<BR><FONT SIZE=2 FACE="Arial"> "Content-Disposition: attachment; filename=$pagename.doc");</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I also stripped down print.tmpl so I get a pretty clean looking Word document.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">However, I'd really like to implement this as add on functionality rather than butchering the print action.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Can anyone give me some pointers on this (maybe sample code)?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks.</FONT>
</P>
</BODY>
</HTML>