I am using the Outlook.MailItem object to extract fields such as
ReceivedBy, SenderName and Subject from emails, but it seems like there
is no way to get at the actual received by email address and sent by
email address, I can only get at the actual name of the sender and
recipient.
Is there any other way to get these email addresses?
Andy - 10 May 2007 17:29 GMT
> I am using the Outlook.MailItem object to extract fields such as
> ReceivedBy, SenderName and Subject from emails, but it seems like there
[quoted text clipped - 3 lines]
>
> Is there any other way to get these email addresses?
Did you look at the Recipients collection on MailItem, as well as
SenderEmailAddress?
Mike P - 11 May 2007 09:03 GMT
I can't find SenderEmailAddress in intellisense for this object...are
you sure you can get this?
Mike P - 11 May 2007 09:58 GMT
SenderEmailAddress is only available in Outlook 11...is there anything
similar I can use in Outlook 10?
Mike P - 11 May 2007 10:35 GMT
I have found this code in VB to get the ReplyTo address. Can anybody
tell me how to declare the Reply object?
Set objReply = objMsg.Reply
On Error Resume Next
Set objRecip = objReply.Recipients.Item(1)
If Err = 0 Then
' address will be in Name or Address depending
' on sending application and type of address
strAddress = objRecip.Address
If strAddress = "" Then
strAddress = objRecip.Name
End If
ElseIf Err = 287 Then
'handle possible security patch error
strAddress = ""
MsgBox "The Outlook E-mail Security Patch is " & _
"apparently installed on this machine. " & _
"You must response Yes to the prompt about " & _
"accessing e-mail addresses if you want to " & _
"get the Reply To address.", vbExclamation, _
"GetReplyToAddress"
End If
Paul Shapiro - 11 May 2007 17:22 GMT
It looks like it's the reply to an Outlook mail item, which would be another
mail item, so try Outlook.mailItem if you've included the Outlook reference.
If that doesn't work you can dim as Object.
Paul Shapiro
>I have found this code in VB to get the ReplyTo address. Can anybody
> tell me how to declare the Reply object?
[quoted text clipped - 19 lines]
> "GetReplyToAddress"
> End If