write RTFText of a field works on a Word file but not on an Excel file

Andre.Bisseret Andre.Bisseret at inria.fr
Fri Apr 25 09:27:33 EDT 2008


I have a stack where I export the content of a field (fldSource) into  
a Word file (thisWordFile.doc) which is in "thisFolder" on the desktop.

I have the following script in a button:

ON mouseUp

set the defaultfolder to specialfolderpath("desktop") & "/thisFolder"

   open file "ThisWordFile.doc" FOR write

   write the rtftext of fld "fldSource" to file " ThisWordFile.doc "

   close file "ThisWordFile.doc"

   launch document "ThisWordFile.doc"

END mouseUp

This script is working as expected : the text of the fldSource is  
imported in the file "thisWordFile" keeping all formatting features :  
colors, underline, italic, bold.

Now, I am trying to do the same but in Excel : exporting the content  
of a field "FldSource" in an Excel file (thisExcelFile.xls) which is  
in the same folder (thisFolder).

Then a strickly identical script (only changing the file: a file «  
ThisExcelFile.xls » instead of "ThisWordFile.doc") does not work. I  
don't keep the formatted text of the field in the Excel file; I get  
the rtf code of the text :-((

Thank in advance for any help,

Best regards from Grenoble


More information about the Use-livecode mailing list