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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save Mail in DBF

Status
Not open for further replies.

fluppe689

Programmer
Jul 11, 2008
75
BE
Hi Experts

A litte question.
In my program, in the form adresses i save the e-mail address. With a buttom I open Outlook and put the email adress into to cc.
So far no problem.

What I would like to do is to save the body and the subject and the attachtments in a DBF file.

Is this possible and how do I do this.

Wfg,

Filip
 
Filip,

Yes, this is possible.

The message's Subject property contains the text of subject. So, assuming oMail contains an object reference to the message, you can do this:

? oMail.Subject && prints the subject

or this:

SELECT SomeTable
REPLACE Subject WITH oMail.Subject

Attachments are a little more complicated. The message has an attachments collection. You can loop through this collection to retrieve each individual attachment:

FOR EACH oAttach IN oMail.Attachments
? oAttach.FileName && prints the filename
ENDFOR

Similarly, you could place the filename in your table. Or, you can call oAttach.SaveAsFile to save the attachment in its own file.

Hope this helps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top