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

using FoxPro to send e-mail with attachment

Status
Not open for further replies.

danford

Technical User
Jan 14, 2002
1
AU

I program in FoxPro only a bit. I have this code, which will create a spreadsheet from a table, and open up an e-mail message with the spreadsheet as an attachment.

Question: what code can I add to pass put a vaiable in the subject or body of the message ?

___________________________________

PROCEDURE XLS_email
*** Create an Excel 5.0 file from oes_temp.dbf and send it as an e-mail attachment
filepath = "C:\oes" + ALLTRIM(curyear) + "sic" + ALLTRIM(cursiccode) + ".XLS"
filename = "oes " + curyear + " sic" + cursiccode
SELECT oes_temp
COPY TO &filepath. TYPE XLS
sendtoemail="C:\PROGRA~1\MICROS~2\Office\OUTLOOK.EXE " + filepath
RUN &sendtoemail.
DELETE FILE &filepath.
RETURN

____________________


Thanks!

 
If you're using outlook as your mail client, create the Outlook.Application automation object and manipulate it. JHall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top