<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using ColdFusion to Generate a Custom Word Document</title>
	<atom:link href="http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/</link>
	<description>my code snips</description>
	<lastBuildDate>Thu, 02 Feb 2012 01:32:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Joe</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1828</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 18 Oct 2010 18:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1828</guid>
		<description>Mohammed, 

I would seriously consider using cfreport&apos;s label feature instead and make the format=&quot;rtf&quot;.</description>
		<content:encoded><![CDATA[<p>Mohammed, </p>
<p>I would seriously consider using cfreport&apos;s label feature instead and make the format=&quot;rtf&quot;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1827</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 18 Oct 2010 18:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1827</guid>
		<description>dsam, 

http://forums.techarena.in/office-update-service/1283466.htm

Looks like there&apos;s not necessarily a solution as you have it because of security patches.  So use &lt;cfcontent type=&quot;application/rtf&quot;&gt; instead.</description>
		<content:encoded><![CDATA[<p>dsam, </p>
<p><a href="http://forums.techarena.in/office-update-service/1283466.htm" rel="nofollow">http://forums.techarena.in/office-update-service/1283466.htm</a></p>
<p>Looks like there&apos;s not necessarily a solution as you have it because of security patches.  So use &lt;cfcontent type=&quot;application/rtf&quot;&gt; instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1826</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 18 Oct 2010 18:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1826</guid>
		<description>Carlos,
I would suggest that you create the document in Word that has the headers/footers, page breaks, etc. and use variables in it like ~CompanyName~, ~FirstName~, ~LastName~, etc.  Save it as an rtf.
Then copy the file to your server.  Have Coldfusion read the file and do the replacements (replace()).  Then serve the file back to the user via the cfcontent method that Jen describes above.  Make sure you use the &quot;all&quot; parameter of the replace statement so that all variables are changed on every page (not just the first instance of the variable).</description>
		<content:encoded><![CDATA[<p>Carlos,<br />
I would suggest that you create the document in Word that has the headers/footers, page breaks, etc. and use variables in it like ~CompanyName~, ~FirstName~, ~LastName~, etc.  Save it as an rtf.<br />
Then copy the file to your server.  Have Coldfusion read the file and do the replacements (replace()).  Then serve the file back to the user via the cfcontent method that Jen describes above.  Make sure you use the &quot;all&quot; parameter of the replace statement so that all variables are changed on every page (not just the first instance of the variable).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1825</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Mon, 18 Oct 2010 16:15:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1825</guid>
		<description>Is there any way to create word documents ala &lt;cfdocument&gt;? 

as in with headers, pagebreak, footers, etc.
im using CF 9

thanks for your time.</description>
		<content:encoded><![CDATA[<p>Is there any way to create word documents ala &lt;cfdocument&gt;? </p>
<p>as in with headers, pagebreak, footers, etc.<br />
im using CF 9</p>
<p>thanks for your time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dsam6891</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1785</link>
		<dc:creator>dsam6891</dc:creator>
		<pubDate>Wed, 06 Oct 2010 21:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1785</guid>
		<description>Hi, I am new to CF.. I am trying to generate labels (basic first name and last name) from MS Access. Here is the code I am using : 

&lt;!--- Get Names from the database---&gt;
&lt;cfquery name =&quot;GetNames&quot; datasource = &quot;playdb&quot;&gt;
Select FirstName, LastName
From Instructors 
&lt;/cfquery&gt;

&lt;!--- Location of our RTF template ---&gt;
&lt;cfset pathToRTF =  GetDirectoryFromPath(GetCurrentTemplatePath()) &amp; &quot;nametags.rtf&quot; /&gt;  

&lt;!--- Read RTF template into variable called “RTF” ---&gt;
 &lt;cfset rtf = FileRead(pathToRTF) /&gt;

&lt;!--- Replace “placeholders” with specific information ---&gt;
&lt;cfset rtf = Replace(rtf, &quot;%First Name%&quot;, GetNames.FirstName)&gt;

&lt;cfset rtf = Replace(rtf, &quot;%Last Name%&quot;,GetNames.LastName)&gt;

&lt;!--- Default filename for document ---&gt;
&lt;cfheader name=&quot;Content-Disposition&quot; value=&quot;filename=WordNametag.doc&quot;&gt;

&lt;!--- Set the content-type so Word is invoked ---&gt;
&lt;cfcontent type=&quot;application/msword&quot;&gt;
&lt;cfoutput&gt;#rtf#&lt;/cfoutput&gt;
_____________________________________________________

The code does invoke word (with this error message: &apos;We cannot Start the converter mswrd632&apos;). After clicking OK twice, a 12 page document pops up with a bunch of 0&apos;s and 1&apos;s and some formatting code. What am I missing here? 

I would really appreciate any help !

Thanks</description>
		<content:encoded><![CDATA[<p>Hi, I am new to CF.. I am trying to generate labels (basic first name and last name) from MS Access. Here is the code I am using : </p>
<p>&lt;!&#8212; Get Names from the database&#8212;&gt;<br />
&lt;cfquery name =&quot;GetNames&quot; datasource = &quot;playdb&quot;&gt;<br />
Select FirstName, LastName<br />
From Instructors<br />
&lt;/cfquery&gt;</p>
<p>&lt;!&#8212; Location of our RTF template &#8212;&gt;<br />
&lt;cfset pathToRTF =  GetDirectoryFromPath(GetCurrentTemplatePath()) &amp; &quot;nametags.rtf&quot; /&gt;  </p>
<p>&lt;!&#8212; Read RTF template into variable called “RTF” &#8212;&gt;<br />
 &lt;cfset rtf = FileRead(pathToRTF) /&gt;</p>
<p>&lt;!&#8212; Replace “placeholders” with specific information &#8212;&gt;<br />
&lt;cfset rtf = Replace(rtf, &quot;%First Name%&quot;, GetNames.FirstName)&gt;</p>
<p>&lt;cfset rtf = Replace(rtf, &quot;%Last Name%&quot;,GetNames.LastName)&gt;</p>
<p>&lt;!&#8212; Default filename for document &#8212;&gt;<br />
&lt;cfheader name=&quot;Content-Disposition&quot; value=&quot;filename=WordNametag.doc&quot;&gt;</p>
<p>&lt;!&#8212; Set the content-type so Word is invoked &#8212;&gt;<br />
&lt;cfcontent type=&quot;application/msword&quot;&gt;<br />
&lt;cfoutput&gt;#rtf#&lt;/cfoutput&gt;<br />
_____________________________________________________</p>
<p>The code does invoke word (with this error message: &apos;We cannot Start the converter mswrd632&apos;). After clicking OK twice, a 12 page document pops up with a bunch of 0&apos;s and 1&apos;s and some formatting code. What am I missing here? </p>
<p>I would really appreciate any help !</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamad</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1770</link>
		<dc:creator>Mohamad</dc:creator>
		<pubDate>Wed, 22 Sep 2010 23:33:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1770</guid>
		<description>Jen, is there a way to loop over the contents of the word file? For example, let&apos;s say you wanted to generate several mailing labels based on a query output. Would you have to create a single file for each query row, or can you create a single placeholder and loop over it as many times as there are rows in a query? My intention is to generate address labels. The number will always vary, but I would like to output them to the same file.</description>
		<content:encoded><![CDATA[<p>Jen, is there a way to loop over the contents of the word file? For example, let&apos;s say you wanted to generate several mailing labels based on a query output. Would you have to create a single file for each query row, or can you create a single placeholder and loop over it as many times as there are rows in a query? My intention is to generate address labels. The number will always vary, but I would like to output them to the same file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1534</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 29 Jun 2010 16:15:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1534</guid>
		<description>Just a note for Michael (above).  You can also simply write html to a file with a .doc extension and Word will  open it and it will have the html formatting.  And if you have Word on your server, you can issue a read of the file and then issue a &quot;save as&quot; (via COM -- you&apos;ll have to good that) with an rtf extension and it will save it.  (It creates an instance of Word on the server though, so you wouldn&apos;t want this to be high volume.)  
Also, ActivePDF will convert from html to PDF or Word to PDF. http://www.activepdf.com/products/serverproducts/docconverter/overview.cfm</description>
		<content:encoded><![CDATA[<p>Just a note for Michael (above).  You can also simply write html to a file with a .doc extension and Word will  open it and it will have the html formatting.  And if you have Word on your server, you can issue a read of the file and then issue a &quot;save as&quot; (via COM &#8212; you&apos;ll have to good that) with an rtf extension and it will save it.  (It creates an instance of Word on the server though, so you wouldn&apos;t want this to be high volume.)<br />
Also, ActivePDF will convert from html to PDF or Word to PDF. <a href="http://www.activepdf.com/products/serverproducts/docconverter/overview.cfm" rel="nofollow">http://www.activepdf.com/products/serverproducts/docconverter/overview.cfm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jen</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1521</link>
		<dc:creator>jen</dc:creator>
		<pubDate>Mon, 28 Jun 2010 21:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1521</guid>
		<description>@Joe
Thanks for the info. It is a kludge at best no matter how it is done. But, it can be done, like you said, with limitations.</description>
		<content:encoded><![CDATA[<p>@Joe<br />
Thanks for the info. It is a kludge at best no matter how it is done. But, it can be done, like you said, with limitations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1511</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 28 Jun 2010 19:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1511</guid>
		<description>I bet the person wanting to know how to get variables on page 2 or beyond may be using the same variable on those pages that they used on page 1.  Therefore, they simply need the &quot;All&quot; parameter at the end of the replace() function.  
However, I will tell you that there may be some sort of limitation on the number of replacements in a single document because I&apos;m fine up to maybe 100 statements or so and then it just stops replacing.  It could be a memory limitation.</description>
		<content:encoded><![CDATA[<p>I bet the person wanting to know how to get variables on page 2 or beyond may be using the same variable on those pages that they used on page 1.  Therefore, they simply need the &quot;All&quot; parameter at the end of the replace() function.<br />
However, I will tell you that there may be some sort of limitation on the number of replacements in a single document because I&apos;m fine up to maybe 100 statements or so and then it just stops replacing.  It could be a memory limitation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jen</title>
		<link>http://www.jensbits.com/2009/06/21/using-coldfusion-to-generate-a-word-document/comment-page-2/#comment-1006</link>
		<dc:creator>jen</dc:creator>
		<pubDate>Fri, 05 Mar 2010 19:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.jensbits.com/?p=238#comment-1006</guid>
		<description>@Don

&quot;Leave the porn! It makes your site more popular. lol&quot;

That actually crossed my mind...</description>
		<content:encoded><![CDATA[<p>@Don</p>
<p>&quot;Leave the porn! It makes your site more popular. lol&quot;</p>
<p>That actually crossed my mind&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

