CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    How To Download Attachments to Hard Drive Using MAPI Controls

    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



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How To Download Attachments to Hard Drive Using MAPI Controls

    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.


  3. #3
    Guest

    Re: How To Download Attachments to Hard Drive Using MAPI Controls

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured