View Single Post
  #6  
Old February 13th 08, 07:20 AM posted to microsoft.public.outlook.program_vba
dkgb
external usenet poster
 
Posts: 7
Default Get smtp address on send

I'm still struggling with this. Here is a code snippet. The comments detail
the the issues I am having with addressentry and SMTPAddress:

Function FileSendingEmail(MyMail As Object)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim SafeMail
Dim SMTPAddress

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set SafeMail = CreateObject("Redemption.SafemailItem")
SafeMail.item = myMail

SMTPAddress = SafeMail.Recipients(1).AddressEntry.SMTPAddress
‘Error “Index must be between 1 and count”

SMTPAddress = SafeMail.item.Recipients(1).AddressEntry.SMTPAddre ss
‘Generates security warning then error “object does not support this
property or method”


MsgBox SMTPAddress

End function


"Ken Slovak - [MVP - Outlook]" wrote:

If you're using Redemption then RDOAddressEntry has an SMTPAddress property.
So does Redemption.AddressEntry. Use either RDORecipient.AddressEntry or
Recipient.AddressEntry to get the AddressEntry objects.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"dkgb" wrote in message
...
Thanks Ken,

I've tried that but it does not necessarily give me the SMTP address. I
need the SMPT address to look someting up in an Access database. Any
other
suggestions? I think there must be a way using Redemption.



Ads