Q:

VBA Outlook MailItem. Sender. Property ("Department")

I am building a VBA script in outlook to be executed every time a mail is received, but how the script processes the e-mail needs to depend on the properties of the contact card. 
When I right click the contact in outlook and view the contact card I can see a variety of properties including "Department", "Mobile" etc. 
What VBA property must I use to sort by "Department"? 

A:

These properties can be accessed using MailItem. Sender. PropertyAccessor. GetProperty.  For the department, the property you want is PR_DEPARTMENT_NAME (DASL name http://schemas.microsoft.com/mapi/proptag/0x3A18001F). 
Take a look at the data with OutlookSpy - select the message, click the IMessage button, select the PR_SENDER_ENTRYID property, right click, select IMAPISession::OpenEntry.