Does anyone have any sample code where you can detect all incoming email and all unread/old emails.
Printable View
Does anyone have any sample code where you can detect all incoming email and all unread/old emails.
What are you using Express? Outlook?
Yes Outlook is my primary, however I would like to use any and all email address (i.e. hotmail). Which ever is easiest at this point.
I found it:
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.FetchUnreadOnly = True
MAPIMessages1.Fetch
If MAPIMessages1.MsgCount > 0 Then
Text1.Text = MAPIMessages1.RecipDisplayName
Text2.Text = MAPIMessages1.MsgSubject
Text3.Text = MAPIMessages1.MsgOrigDisplayName
Text4.Text = MAPIMessages1.MsgNoteText
Command4.Enabled = True
Else
MsgBox "No messages to fetch"
MAPISession1.SignOff
Command4.Enabled = False
End If
I'm happy that you found it, but you should use a grid or something to "fetch" the messages, shouldn't you? What I mean is, what if more than 1 message found?