elmnas
03-09-2016, 01:43 AM
Hello people,
I wonder how to iterate a certain outlook folder
for each email that contains a emailadress
list it in a excelsheet?
I believe this is a beginning though:
Sub test()
Dim objNS As Outlook.NameSpace: Set objNS = GetNamespace("MAPI")
Dim olFolder As Outlook.MAPIFolder
Set olFolder = objNS.GetDefaultFolder(olFolderInbox)
Dim Item As Object
For Each Item In olFolder.Items
If TypeOf Item Is Outlook.MailItem Then
Dim oMail As Outlook.MailItem: Set oMail = Item
MsgBox oMail.SenderEmailAddress
End If
Next
End Sub
I have been trying following stuff:
http://www.slipstick.com/developer/print-list-of-outlook-folders/
http://www.gregthatcher.com/Scripts/VBA/Outlook/GetListOfOutlookEmails.aspx (http://www.gregthatcher.com/)
Could someone help me?
Thank you in advance
I wonder how to iterate a certain outlook folder
for each email that contains a emailadress
list it in a excelsheet?
I believe this is a beginning though:
Sub test()
Dim objNS As Outlook.NameSpace: Set objNS = GetNamespace("MAPI")
Dim olFolder As Outlook.MAPIFolder
Set olFolder = objNS.GetDefaultFolder(olFolderInbox)
Dim Item As Object
For Each Item In olFolder.Items
If TypeOf Item Is Outlook.MailItem Then
Dim oMail As Outlook.MailItem: Set oMail = Item
MsgBox oMail.SenderEmailAddress
End If
Next
End Sub
I have been trying following stuff:
http://www.slipstick.com/developer/print-list-of-outlook-folders/
http://www.gregthatcher.com/Scripts/VBA/Outlook/GetListOfOutlookEmails.aspx (http://www.gregthatcher.com/)
Could someone help me?
Thank you in advance