I am going off of a suggestion to start here to accomplish my task:

http://www.cfcomet.com/Word/index.cfm?ArticleID=54E12395-5696-11D3-B3E8004033E03EF9


I am trying to get a collection of the fields in a word document, then loop through 
the collection looking for fields that are of type wdFieldMergeField as specified on 
MSDN... basically to test for merge fields in a word document. All I need to know is 
if one field type is of wdFieldMergeField type. 

Reading through the docs at MSDN I think I know what I need to do, but I can not seem 
to create the COM object to get going. The page just hangs when I run this code:

<!--- Create the object --->
<CFTRY>
    <!--- If it exists, connect to it --->
    <CFOBJECT 
        ACTION="CONNECT" 
        CLASS="Word.Application" 
        NAME="objWord" 
        TYPE="COM">
  <CFCATCH>
    <!--- The object doesn't exist, so create it --->
    <CFOBJECT 
        ACTION="CREATE" 
        CLASS="Word.Application" 
        NAME="objWord" 
        TYPE="COM"> 
  </CFCATCH>
</CFTRY>

<CFSCRIPT>
    /* Get the document object */
    objDoc = objWord.Documents;   
    
    /* Open the document with the form fields */
    newDoc = objDoc.open("C:\CFusionMX\wwwroot\temp1.doc"); 
    
    /* Get all fields within the document */
    docFields = newDoc.Fields;
</CFSCRIPT>

Does anyone see what I am doing wrong? I am on windows xp with CFMX. The word file is 
in the correct location and I have MS Word installed.


Thanks,

Michael Tangorre
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to