Picking up the sender

  • Thread starter Thread starter Allan Seagrott
  • Start date Start date
A

Allan Seagrott

Hi

I'm creating an outlook mailitem (outlook 2002) from another application
through the redemption/outlook object model. After doing a send I'd like to
pick up the sender's address that was used to send the message ie mine if I
was the one originating the message. Do I need to delve into the MAPI
namespace to determine this?

thanks in advance
Allan.
 
Here's a sample from this link that shows how you can do it using CDO:
http://www.cdolive.com/cdo5.htm#EMailAddressesOfCurrentUser

The e-mail addresses (also known as 'Proxy Addresses') are stored in a
multivalued MAPI property. Here is how to read this multivalued property:
' MAPI property tag for e-mail addresses
Public Const PR_EMS_AB_PROXY_ADDRESSES = &H800F101E

' Array for e-mail addresses
Dim strAddresses

' Get current user object
Set objAddressEntry = objSession.CurrentUser

' Get the fields collection of the address entry
Set objFields = objAddressEntry.Fields

' Pull out proxy addresses
Set objMailAddresses = objFields.Item(PR_EMS_AB_PROXY_ADDRESSES)
If Not objMailAddresses Is Nothing Then

' Add the addresses to an array
strAddresses = objMailAddresses.Value

' Loop through the array and display single address
For intCounter = LBound(strAddresses) To UBound(strAddresses)
MsgBox intCounter & ". E-mail address: " & strAddresses(intCounter)
Next
 
Back
Top