Has anyone gotten CFMX to do anything more than open Word and close it???

I'm trying to access some fields within a Word doc and pump them to a database and I'm 
running into serious problems.

I'm running CFMX Developer (Enterprise) with Updater 2 applied
Accessing Word 2000

<CFSET pathToDoc = "D:\Inetpub\wwwroot\Office\Docs\WordForm.doc">
<CFSCRIPT>
// Create an instance of Word on the server
objWord = CreateObject("COM", "Word.Application");
objWord.visible = false;
// Get the Word document you need to open 
objDoc = objWord.Documents.open(pathToDoc);

/* Get all fields within the document */
FirstName = objDoc.FormFields["FirstName"].Result; **** Fails Here! ***
LastName = objDoc.FormFields["LastName"].Result;

// Show Output variables, or lack thereof...
WriteOutput("Finished Opening and Closing " & pathToDoc & " Successfully... <BR>");
WriteOutput("FirstName = " & FirstName & "<BR>");
WriteOutput("LastName = " & LastName & "<BR>");

// Object Cleanup...
objDoc.close();
objWord.quit();
</CFSCRIPT>

Error is below:

      An exception occurred when accessing a Com object field.  
      The cause of this exception was that: 
coldfusion.runtime.java.MethodSelectionException: Method selection Exception..  
        
      The error occurred in D:\Inetpub\wwwroot\Office\getValues_Server.cfm: line 10
     
8 : 
9 : /* Get all fields within the document */
10 : FirstName = objDoc.FormFields["FirstName"].Result;
11 : LastName = objDoc.FormFields["LastName"].Result;
12 : 

     

Any takers???

Jeff

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to