Copy link to clipboard
Copied
Hi,
I'm able to use CFcontent and CFheader tags etc. to generate a Word doc with dynamic data on the fly and such Word doc has several pages. An issue is the last page has double headers and footers. The following is the process:
1) <cfsavecontent
variable = "WDcontent">
2) Use Microsoft XML and Word style guide
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<style>
</style>
3) continue with HTML body output
toward the end and before the top level DIV ends,
add the header and footer reference,
<table id='hrdftrtbl' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td>
<div style='mso-element: header' id="h1">
<p style='text-align: center'>
<img src="#baseURL#/header2.png" width="90%" height="75">
</p>
</div>
</td>
<td>
<div style='mso-element: footer' id="f1">
<p align="right">
<span style=mso-tab-count:2'>
<img src="#baseURL#/footer2.png" width="90%" height="15">
</span>
</p>
</div>
</td>
</tr>
</table>
Then, after HTML closing
</cfsavecontent>
4) direct output to Word
<!--- WORD version --->
<cfheader name="content-disposition" value="filename=myNew.doc">
<cfcontent type="application/msword">
<cfprocessingdirective suppressWhiteSpace = "true">
<cfoutput>#WDcontent#</cfoutput>
</cfprocessingdirective>
Thoughts?
tia.
Solved.
Copy link to clipboard
Copied
Solved.
Copy link to clipboard
Copied
Please share. I'm curious, myself. And maybe someone else runs across the same issue, and could use your wisdom on this.
V/r,
^_^
Copy link to clipboard
Copied
pm me.
Copy link to clipboard
Copied
Unless your code is proprietary, it would be better to post your solution here (as WolfShade suggested) for the future benefit of anyone who encounters the same issue. If you aren't willing to do that, then maybe you can delete the question entirely so it doesn't become a "dead end" of frustration for those who come along later.
Thank you,
-Carl V. - Moderator
Copy link to clipboard
Copied
Well, i guess i'm f*cked 🙂