Click to See Complete Forum and Search --> : How To Download Attachments to Hard Drive Using MAPI Controls


October 8th, 1999, 03:07 AM
Hello ,

I am using MAPI Controls for my Mail Application. I am able to Send Email with Attachments. But when I receive New Mails with Attachments , how do I download the Attachment physically into my Hard Drive by writing Code. MAPI is supporting with sending Attachments only with Outgoing messages.

Even I am unable to know the Receiving Attachment Count for my Incoming Mail from the Server.

Do U have any solution for my problem


Robert

Lothar Haensler
October 8th, 1999, 05:55 AM
I just wrote the following app:

mas.SignOn
mam.SessionID = mas.SessionID
mam.Fetch
mas.SignOff

after the fetch I was able to access the AttachmentPathName property of the message. That property contains the path to the attachment (in the temp directory).
One more hint, I set DownLoadMail to true in my mapiSession control.

October 11th, 1999, 02:17 AM
Hello Lothar Haensler,

I just wrote the following lines as u said

objMapiSession.SignOn

objMapiSession.DownLoadMail = True

objMapiMessage.MessageId = objMapiSession.MessageId

objMapiMessage.Fetch

' Here I attempted to access the AttachmentCount Property of the Unread Messages in the Inbox by processing through the Message Collection
' But the count is being shown as 0. Next the attachmentpathname property is returning empty string.

objMapiMessage.SignOff


Please let me know where I made a flaw.. ASAP

Regards

Robert