Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Extract Country/Region of email sender from outlook message

Hi, I've got the macro below which lists the Subject and Senders name
of emails in a specific folder.
I also need to pull out which region the sender is in. If I double
click the senders name manually through outlook, the field I want to
extract is under Country/Region on the general tab.

Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("SYD").Folders("CredCheck-CP")
i = 1

For Each olMail In Fldr.Items
ActiveSheet.Cells(i, 1).Value = olMail.Subject
ActiveSheet.Cells(i, 2).Value = olMail.SenderName
i = i + 1
Next olMail

Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

Thanks
Tony

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to cc the sender using vba and outlook cluckers Excel Discussion (Misc queries) 0 December 31st 09 06:13 PM
hyperlink to an Outlook email message Gary''s Student Excel Discussion (Misc queries) 1 March 12th 09 02:05 PM
How do I retrieve message details like the sender name into Excel Pradeep Excel Discussion (Misc queries) 0 December 5th 06 11:33 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Excel Programming 0 December 12th 04 04:03 PM
Copy and Paste from Excel into Outlook Email message TroyB[_2_] Excel Programming 0 November 10th 04 08:01 AM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"