Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email attachments in VFP using an MS Outlook object
Message
From
25/01/1999 07:18:21
 
 
To
21/01/1999 18:31:11
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00178788
Message ID:
00179751
Views:
25
*set step on
*-this Method creats an email, it attaches the required data
*-progmaticly
select mailtosend
*set step on
copy to array paAttchFiles fields name for NOT mailtosend.done && copy file names to an array
*copy to array paAttchFiles fields mailtosend.done for not mailtosend.done && copy file names to an array
thisform.OLESessionCtrl.Signon && Creat the logon session
with Thisform.OleMessageCtrl
.SessionID = Thisform.OleSessionCtrl.SessionID && get the next ID no
.Compose &&compose an email in memory
.RecipAddress = 'Iain Brodie' && address it to me
.ResolveName && Let system find out the proper address
.msgIndex = -1 && set the Message Index count
.msgsubject = alltrim(pcclientsname) && Put this as the Subject
.msgnotetext = " Please Put on disk for client" && put this in the main body of message
AttachmentDone=1 && Creat a counting varible for the Attachment counter

*-this for loop counts how many files there are to be attached
*-for each file name there is two files to be attached
for lncount = 1 to alen(paAttchFiles)
.AttachmentIndex = AttachmentDone -1
.AttachmentPathName = (pcclintspath+'download\'+paAttchFiles(lncount)+'SO.dbf')
.Attachmentposition = AttachmentDone -1
AttachmentDone=AttachmentDone+1
endfor

endwith
*set step on
with thisform.OleMessageCtrl
.send(1) && show predefined email with fields filled in
endwith
*-this part sets the flags on the data, so we do not get duplicate files
select mailtosend
for i = 1 to alen(paAttchFiles)
loca for mailtosend.name=paAttchFiles(i)
replace mailtosend.sentdate with datetime(), mailtosend.done with .T.
endfor
thisform.release
Iain Brodie
Previous
Reply
Map
View

Click here to load this message in the networking platform