This content has been marked as final. Show 2 replies
The last time I had to deal with a requirement like this, which was
about 2000-2001, we eventually scrapped the word COM thing. Even then
it was such a fragile and perilous solution, fraught with problems and
What we ended up doing, that was much easier, was to create a .rtf, rich
text format, file. We could do all the required formating in this
format, and 90% of the uses would have this file open in MS Word and not
even know they did not get a .doc file.
How we did it was create a .rtf template with dummy text that had all
the desired formating. Then we could read in the .rtf file, which is
just a marked-up text file, not a binary, and string replace the dummy
text with the dynamic text. Save it again and viola a rich text
formated file with the required content.
These days, I would push for doing this in PDFs and use ColdFusion's
<cfdocument...> and|or <cfpdf...> functionality. But if it has to be
Word, I suppose it has to be Word.
I looked at doing it in PDF. What I found was the field size remained the same as the field I input in originally. So if I have a name, like "My Name is" and the name was "This is a long name" it wouldn't work. I may have dismissed it early with out much research, and there maybe a work around, but that is what I found.
I will look into the RTF solution.
If anyone has any other input on this, I would appreciate it.