0 Replies Latest reply on May 9, 2006 7:01 AM by

    Element DOCUMENTS is undefined in MYWORD

      Hi,

      I have one Coldfusion page which consists of the following code only:
      <HTML>
      <HEAD>
      <TITLE> Test</TITLE>
      </HEAD>

      <CFTRY>
      <CFOBJECT TYPE="COM" NAME="MyWord" CLASS="Word.Application" ACTION="CONNECT" CONTEXT="Local">
      <CFCATCH>
      <H2> cONNECTION fALIED></H2>

      </CFCATCH>
      </CFTRY>



      <CFSET MyWord.Visible="False">
      <CFSET OriginalDoc=MyWord.Documents>
      <CFSET OriginalDoc.Open("C:\CFusionMX7\wwwroot\TestPmud\test.doc")>
      <CFSET ConvertedDoc=MyWord.ActiveDocument>
      <CFSET ConvertedDoc.SaveAs("C:\CFusionMX7\wwwroot\TestPmud\test.htm",Val(8))>

      <CFSET MyWord.Quit()>
      <CFSET ReleaseComObject(MyWord)>

      <BODY>
      <TABLE>
      <TR>
      <TD><A HREF="www.yahoo.com">Yahoo</A></TD>
      </TR>
      </TABLE>
      </BODY>
      </HTML>

      But on runnning this code from IE , i get the following error:

      Your browser is: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
      You were trying to process /testME.cfm
      The 'QUERY STRING' was:
      The specific error was: Element DOCUMENTS is undefined in MYWORD.
      The error occurred on line 17.

      I have Coldfusion MX7 installed on Windows Server 2003 and am running IE 6.0 .

      Please help.

      Thanks