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!

Automated E-mail

Status
Not open for further replies.

Mictain

MIS
Jul 4, 2001
79
GB
I'm trying to find a way to get Outlook 2000 to automatically, at a set time every day, grab a particular excel file and mail it to a client. Is this possible?

If so, could someone please explain how. Thanks.
 
I have some VFP code that mails attached files. You can translate into almost MS language:

***********************************
Lparameters _app,_file,_filevers,_subject,_body
Local loApp,LoSpace,LoNew,Lc_sele,lc_nn,lc_recip,lSuccess,lc_olook
Lc_sele=sele()
leOldError = ON("ERROR")
On ERROR loApp = .NULL.
loApp = GetObject(, _app)
On ERROR &leOldError
lc_olook=.t.
If ISNULL(loApp)
loApp=createobject(_app)
lc_olook=.f.
Endif
LoSpace=loApp.GetNameSpace('MAPI')
loMsg=LoSpace.GetDefaultFolder(4)
LoNew=loMsg.Items.Add()
LoNew.Recipients.Add(allt(ThisForm.List1.List(lc_nn,2)))
LoNew.Subject=_subject
LoNew.Body=_body
* below is the line you really need!
LoNew.Attachments.Add(fullpath(_file),1,1,_file)
*LoNew.Display()
LoNew.Save()
LoNew.Send()
If !lc_olook
loApp.Quit
Endi
Rele loApp
Sele (Lc_sele)
Retu
******************************

Hope it Helps
 
Thanks for this. I'd forgotten all about this thread! I shall go away and get it checked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top