Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ho to encrypting a rtf file ?

Status
Not open for further replies.

mshamz

Programmer
Apr 22, 2002
10
AE
Hi,

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.

Thanx

Shamz
 
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.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top