Help! Read header of Attachment
Hello Frds,
How to read the "FROM" & "TO" of an attached email in outlook. Plz help me.
Lots of Thanks
[120 byte] By [
vicks] at [2007-11-11 8:14:44]

# 1 Re: Help! Read header of Attachment
Add Microsoft MAPI Control to your project..
Put MAPISession and MAPIMessage controls onto your form..
Write the following code ~
MAPISession1.UserName = "" '' Your User Name
MAPISession1.Password = "" '' Your Password
MAPISession1.SignOn ''Sign In
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Fetch
If MAPIMessages1.MsgCount > 0 Then
For i = 0 To MAPIMessages1.MsgCount - 1
MAPIMessages1.MsgIndex = i
'' Checking whether this mail has attachment or not.
If MAPIMessages1.AttachmentCount > 0 Then
List1.AddItem "From:" & MAPIMessages1.MsgOrigDisplayName & _
" Subject:" & MAPIMessages1.MsgSubject & _
" To: " & MAPIMessages1.RecipAddress
End If
Next
End If
MAPISession1.SignOff
Notes that you have to wait a lit bit longer if you have so many messages in your Inbox.. It looks like hang... :-)
Sync at 2007-11-11 17:25:47 >
