Topic: how to save the contents of a memo object to a text file

how to save the contents of a memo object to a text file?

Domebil

2 (edited by derek 2021-01-17 13:14:18)

Re: how to save the contents of a memo object to a text file

Hi,
At its most simple, you can use
  form1.memo1.SaveToFileUTF8('myfile.txt');
You can enhance this, if required to prompt for file names and file paths etc.
To give it a bit of context, in some projects I give the users the facility to create their own help file;  in the attachment, when you click 'HELP', it opens 'formhelp' and loads a text file which can be edited.  When you close 'formhelp', it saves the text file..
You can do the same thing with .rtf files although the syntax in the script is slightly different.
Derek.

Post's attachments

Attachment icon load and save text file.zip 336.54 kb, 216 downloads since 2021-01-17 

Re: how to save the contents of a memo object to a text file

thanks a lot derek

Domebil