hello all, i have a text file that i use as the body of an email message.
something like this..
tmessage=f:\...\...\message.txt
.body=tmessage.

works well. people want to add a line or two to the body. what i have found
is that once they change the text file, it then changes it forever..

can i have a master tmessage.txt and after i email just copy it to the
tmessage to ensure i always use it? and how can i do that with a txt file,
copy replace etc fail. unless i am doing it wrong. which is possible.

RE: text file edit and copy in VFP by MichelRoy

MichelRoy
Wed Nov 30 11:39:11 CST 2005

i don't know what you use to send email, but if .body is set to a file name,
you would do something like

myAddedText = CHR(13)+chr(10)+"see you soon." + chr(13)+chr(10)+"Tom."

tmessage = "f:\...\...\message.txt"

tmpfile = addbs(getenv("temp")) + sys(2015) + ".txt"
= STRTOFILE(FILETOSTR("&tmessage.")+ myAddedtext, "&tmpfile.")
.body = tmpfile

but then you would need to clean those temp files...

"Tom" wrote:

> hello all, i have a text file that i use as the body of an email message.
> something like this..
> tmessage=f:\...\...\message.txt
> .body=tmessage.
>
> works well. people want to add a line or two to the body. what i have found
> is that once they change the text file, it then changes it forever..
>
> can i have a master tmessage.txt and after i email just copy it to the
> tmessage to ensure i always use it? and how can i do that with a txt file,
> copy replace etc fail. unless i am doing it wrong. which is possible.

RE: text file edit and copy in VFP by cindy_winegarden

cindy_winegarden
Thu Dec 01 17:55:02 CST 2005

Hi Tom,

How are people editing the text? From inside or outside of VFP? You could
use FileToStr() and show the string variable in an EditBox on a form. That
way people can edit to their heart's content and not touch the original.


--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"Tom" wrote:

> hello all, i have a text file that i use as the body of an email message.
> something like this..
> tmessage=f:\...\...\message.txt
> .body=tmessage.
>
> works well. people want to add a line or two to the body. what i have found
> is that once they change the text file, it then changes it forever..
>
> can i have a master tmessage.txt and after i email just copy it to the
> tmessage to ensure i always use it? and how can i do that with a txt file,
> copy replace etc fail. unless i am doing it wrong. which is possible.