this is kind of what i was hoping to bypass was converting to html and then reformatting them to print properly. my place in the workflow of this project is that the word documents are given to me in complete form. anything to just dump them on the server and allow for the ability to print them is what i am looking for, instead of trying to reformat them and take up my time on that aspect.
as for opening the document, it is an option, although i would prefer to initiate a print command instead of having the user do so (unless you can initiate an automatic print command with a word macro when the document is opened? and then close the document after the print command has completed?)
Main Topics
Browse All Topics





by: AtabiaPosted on 2005-10-05 at 06:35:41ID: 15021628
Step 1 - Open Word and create a new document looking just the way you want it - formatting, page breaks, whatever. Put sample values in for any dynamic text.
value="inline; filename=printable.doc">
urDocument .doc' and the browser will take care of opening word for you. Then to print it's the normal print process.
Step 2 - File >> Save As >>> save as HTML (in Word)
Step 3 - Open the new html file in your favorite HTML editor - it will look like crap. Add any CF code that you need to customize it. It's a mess in there, just do a text search to find what you're looking for.
Step 4 - Save it and rename it to printDocument.cfm
Step 5 - Put the following lines of code at the top and resave:
<cfheader name="Content-Disposition"
<cfcontent type="application/msword">
Step 6 - link to printDocument.cfm, passing any URL variables, etc. that you need.
This allows you to create customized Word documents, although it almost sounds like all you need to do is open existing Word Documents. If that's the case, all you need to do is use the javascript location.href='theNameOfYo