Monday, March 29, 2010

HTML2Word.cfm custom tag

have you used this custom tab? I downloaded this from
coldfusion support and wonder it is working on windows 2003. When I
downloaded this file, windows 2003 did not even come out and
comments on this file said ''This tag will only work on
WindowsNT/2000''. however shouldn't be working on windows 2003
operating system? can you help? (I use CFMX 6.1 update)

HTML2Word.cfm custom tag
the only part of the document that might possibly cause a
problem is the class name the %26lt;Cfobject%26gt; tag is using to
access MS word: Word.Application. As long as you have word
installed on your server and it uses the same class name* it should
work fine.



* not exactly sure how to figure out what class name to use,
though. Maybe try the following and see if you get an error:





%26lt;CFTRY%26gt;

%26lt;CFOBJECT

ACTION=''CONNECT''

CLASS=''Word.Application''

NAME=''objWord''

TYPE=''COM''%26gt;

%26lt;CFCATCH%26gt;

%26lt;CFTRY%26gt;

%26lt;CFOBJECT

ACTION=''CREATE''

CLASS=''Word.Application''

NAME=''objWord''

TYPE=''COM''%26gt;



%26lt;CFCATCH TYPE=''ANY''%26gt;

%26lt;CFABORT SHOWERROR=''%26lt;FONT COLOR='RED'%26gt;Cannot create
Word Object%26lt;BR%26gt;Make sure Word is installed and that
ColdFusion has permissions to use the Word COM
objects%26lt;/FONT%26gt;%26lt;BR%26gt;%26lt;B%26gt;Error Details:%26lt;/B%26gt;
#CFCATCH.MESSAGE#''%26gt;

%26lt;/CFCATCH%26gt;

%26lt;/CFTRY%26gt;

%26lt;/CFCATCH%26gt;

%26lt;/CFTRY%26gt;

HTML2Word.cfm custom tag
I tried and still got the same error message as below. (btw,
the code that you provided is same as that I posted here)

something went wrong with connection to the word object on
win2003.

btw, any other custom tag to convert HTML to Word other than
I posted? thank you.

--------------------------------------------------------

Error Occurred While Processing Request

%26lt;FONT COLOR=%26amp;apos;RED%26amp;apos;%26gt;Error occured while
connected to the Word object!%26lt;/FONT%26gt;%26lt;BR%26gt;Error Details:
An exception occurred when executing a Com method.





The error occurred in E:\CFusionMX\CustomTags\HTML2Word.cfm:
line 149



147 : objWord.Quit();

148 : %26lt;/CFSCRIPT%26gt;

149 : %26lt;CFABORT SHOWERROR=''%26lt;FONT COLOR='RED'%26gt;Error
occured while connected to the Word
object!%26lt;/FONT%26gt;%26lt;BR%26gt;Error Details: #CFCATCH.MESSAGE#''%26gt;


150 : %26lt;/CFCATCH%26gt;

151 : %26lt;/CFTRY%26gt;



--------------------------------------------------------------------------------



No comments:

Post a Comment