Is there any way to encrypt an rtf file ? Or is there any way to insert an EOF character at the beginnig of the rtf file, so that it will display anything when some one tries to open it.
The answer to both is yes. If you are using VFP 7.0, there is a foundation class to access the Windows Crypto API routines. For some sample code see ...\Samples\Solution\FFC\Crypto.scx.
Before 7.0, there are a number of freeware, shareware and professional 3rd party add-ins that can provide encryption.
The easiest way to add an EOF character to the beginning of a file (assuming it's less than 16MB and you have enough memory available) is to use the FileToStr() and StrToFile() functions.
=strtofile(chr(0x1A)+filetostr("myfile.rtf","myfile.rtf"
Put SET SAFETY OFF and SET SAFETY ON around this if you don't want to answer the OK to overwrite dialog.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.