Hi all!
   I need to have a list of uploaded word document names on 
a page that when clicked on, allows the word doc to be 
edited and then saved back to the server.  I know that if I 
put the link to a file (on the server) on a page, it will 
open a local version of the document in word that allows 
editing.  This doesn't allow the file to be saved back to 
the server though (with good reason).  In order to save it 
back to the server, the user could upload it to the server 
again after editing (with <CFFILE>).  I was just wondering 
if there is a way for the document to be opened, edited and 
saved back to the server all at once.  I've looked at 
www.cfcomet.com, but I'm not sure if the <CFOBJECT> tag is 
what would work here.

This is the code I pulled off of cfcomet, but I'm a little 
stuck... the code errors out when it hits the second 
<CFOBJECT> tag...? Thank-you for any help :)
            Christine

<!--- Try to connect to the Word application 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>
    /* This will open Word if running locally */
    objWord.Visible = true;
    
    /* This returns the 'Documents' collection of the Word 
object */
    objDoc = objWord.Documents;  
      
    /* Specify a document to open */  
    newDoc = objDoc.open("D:\template.doc");
    
    ... Additional Code ....
    
    /* Save the changes */
    newDoc.Save();
    
    OR
    
    /* If you want to save it as a new document */
    newDoc.SaveAs("D:\template_new.doc");    
    
    /* Close the document */
    newDoc.Close();
    
    /* Quit Word */
    objWord.Quit();
</CFSCRIPT>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to