2 Replies Latest reply on Mar 30, 2007 4:54 AM by HandersonVA

    HTML2Word.cfm custom tag

    HandersonVA Level 1
      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)
        • 1. Re: HTML2Word.cfm custom tag
          insuractive Level 3
          the only part of the document that might possibly cause a problem is the class name the <Cfobject> 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:


          <CFTRY>
          <CFOBJECT
          ACTION="CONNECT"
          CLASS="Word.Application"
          NAME="objWord"
          TYPE="COM">
          <CFCATCH>
          <CFTRY>
          <CFOBJECT
          ACTION="CREATE"
          CLASS="Word.Application"
          NAME="objWord"
          TYPE="COM">

          <CFCATCH TYPE="ANY">
          <CFABORT SHOWERROR="<FONT COLOR='RED'>Cannot create Word Object<BR>Make sure Word is installed and that ColdFusion has permissions to use the Word COM objects</FONT><BR><B>Error Details:</B> #CFCATCH.MESSAGE#">
          </CFCATCH>
          </CFTRY>
          </CFCATCH>
          </CFTRY>
          • 2. Re: HTML2Word.cfm custom tag
            HandersonVA Level 1
            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
            <FONT COLOR=&apos;RED&apos;>Error occured while connected to the Word object!</FONT><BR>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 : </CFSCRIPT>
            149 : <CFABORT SHOWERROR="<FONT COLOR='RED'>Error occured while connected to the Word object!</FONT><BR>Error Details: #CFCATCH.MESSAGE#">
            150 : </CFCATCH>
            151 : </CFTRY>

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