How to syncronize a Accesstable with a Outlook-Folder

J

Jeff2003

My problem is that i'm getting a Error when I want to
read the senders adress.

--> 'MsgBox olMessage.Sender
--> 'MsgBox olMessage.Sender.Name



Private Sub ReadMails(pFolder As String)

Dim olMAPI As MAPI.Session
Dim olInfoStore As MAPI.InfoStore
Dim olFoldersCol As MAPI.Folders
Dim olFolder As Folder
Dim olMessageCol As Messages
Dim olMessage As Message

Set olMAPI = New MAPI.Session
olMAPI.Logon ("test")

Set olInfoStore = olMAPI.GetInfoStore()
Set olFoldersCol = olInfoStore.RootFolder.Folders
With olFoldersCol
For Each olFolder In olFoldersCol
If olFolder.Name = pFolder Then
Set olMessageCol = olFolder.Messages
With olMessageCol
For Each olMessage In olMessageCol
MsgBox olMessage.ID
--> 'MsgBox olMessage.Sender
--> 'MsgBox olMessage.Sender.Name
MsgBox olMessage.Text
MsgBox olMessage.Subject
MsgBox olMessage.Recipients(1).Name
Next olMessage
End With
End If
Next olFolder
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top