Save Mapi.Message as MSG

  • Thread starter Thread starter Nabil
  • Start date Start date
N

Nabil

Hi,

This is the first time I've posted something on here.

I've looked around the web for hours and failed miserably. Hopefully
someone out there would be able to help.

I'm trying to save an MApi.Message (which represents an email) object
to my hard drive or a network drive but I'm getting nowhere. I know I
can use Redemption to do this but I'm trying to avoid 3rd party
products (especially ones I have to pay for)

Here's my code

Dim oSession As New MAPI.Session
Dim oFolder As MAPI.Folder
Dim oMessages As MAPI.Messages
Dim oMessage As MAPI.Message
Dim strEmailAccount As String = "Exchange_Email_Account"
Dim strExchangeServerName As String = "exchange04"

Dim profile As Object = Nothing
Dim strProfile As String = strExchangeServerName & vbLf &
strEmailAccount

oSession.Logon("", , , False, , True, strProfile)

' Get Inbox.
oFolder = oSession.Inbox

' Get Messages collection.
oMessages = oFolder.Messages

' Get the second email
oMessage = oMessages.Item(2)

' Now just saving it should be easy????????????????
 
Back
Top