View Single Post
  #1  
Old April 19th 06, 10:33 AM posted to microsoft.public.outlook.program_vba
Vadivel
external usenet poster
 
Posts: 7
Default inconsistent in Redemption

Hi,

I am trying to get the smtp address of the email item in outlook
offline(machine does not have outlook session). This is the my code.
But sometimes its giving the smtp address and sometimes it gives empty
stirng

Dim UtilObject As Redemption.MAPIUtils
Dim MessageItem As MessageItem
Dim ToAddress As SafeRecipient

Const PR_EMAIL = &H39FE001E

Set UtilObject = CreateObject("Redemption.MAPIUtils")

Set MessageItem = UtilObject.GetItemFromMsgFile("D:/test1.msg")

For Each ToAddress In MessageItem.Recipients

Debug.Print ToAddress.Address ' To get the smpt email id
If InStr(ToAddress.Address, "@") = 0 Then
Debug.Print ToAddress.Fields(PR_EMAIL) ' To get the smpt
email id
end if

Next

here ToAddress.Fields(PR_EMAIL) function sometiem gives proper smtp
address. but sometimes it gives empty string..

Any help really appreciated..

Thanks
Vadivel

Ads