A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

inconsistent in Redemption



 
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old April 19th 06, 04:07 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default inconsistent in Redemption

Dmitry can correct me if I'm wrong but I'd sort of expect inconsistent
results from MAPIUtils unless its MAPIOBJECT property was assigned from some
session's MAPIOBJECT property.

Can you log into Outlook and get the NameSpace to get its MAPIOBJECT?
Perhaps you can use Redemption's RDOSession object to log into a MAPI
session and then use that session's MAPIOBJECT?

I'd also use MAPIUtils.Cleanup at the end of the code to release the session
and clean things up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Vadivel" wrote in message
oups.com...
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


  #3  
Old April 19th 06, 07:09 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default inconsistent in Redemption

PR_SMTP_ADDRESS is only available in the online mode. In the cached mode
(default in Outlook 2003) PR_SMTP_ADDRESS is ont available, so you need to
use PR_EMS_AB_PROXY_ADDRESSES instead (always available for the EX address
entries, see below).
Note that RDOAddressEntry object already exposes the SMTPAddress property.
Next version of Redemption will add that property to the
Redemption.AddressEntry object (returned by the Safe*Item objects).

PR_EMS_AB_PROXY_ADDRESSES = &H800F101E
If AddressEntry.Type = "EX" Then
ProxyAddresses = AddressEntry.Fields(PR_EMS_AB_PROXY_ADDRESSES)
for i = LBound(ProxyAddresses) to UBound(ProxyAddresses)
if Left(ProxyAddresses(i), 5) = "SMTP:" Then
strAddress = Right(ProxyAddresses(i), Len(ProxyAddresses(i))-5)
Exit for
End If
Next
End If


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ken Slovak - [MVP - Outlook]" wrote in message
...
Dmitry can correct me if I'm wrong but I'd sort of expect inconsistent
results from MAPIUtils unless its MAPIOBJECT property was assigned from
some session's MAPIOBJECT property.

Can you log into Outlook and get the NameSpace to get its MAPIOBJECT?
Perhaps you can use Redemption's RDOSession object to log into a MAPI
session and then use that session's MAPIOBJECT?

I'd also use MAPIUtils.Cleanup at the end of the code to release the
session and clean things up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Vadivel" wrote in message
oups.com...
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




  #4  
Old April 20th 06, 09:15 AM posted to microsoft.public.outlook.program_vba
Vadivel
external usenet poster
 
Posts: 7
Default inconsistent in Redemption

Dmitry Streblechenko,

If my machine has only outlook installed and never used it for
downloading email.. Will the above code work still?

Thanks
Vadivel

  #5  
Old April 20th 06, 07:15 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default inconsistent in Redemption

I am not sure I completely understand - do you mean you are reading MSG
files on a machine that might not have a MAPI profile set up to connect to
the Exchange server that used to host the message now saved as an MSG file?.
PR_SMTP_ADDRESS may or may not be available in the message recipients table.
If it is available, then Recipient.Fields(PR_SMTP_ADDRESS) will retrieve it.
If it is not available, the only workaround is to read the value of
PR_ENTRYID and call IAddrBook::OpenEntry - that's what reading
Recipient.AddressEntry would do. But that requires a MAPI session connected
to an EX server that will be able to open the entry id in question.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vadivel" wrote in message
oups.com...
Dmitry Streblechenko,

If my machine has only outlook installed and never used it for
downloading email.. Will the above code work still?

Thanks
Vadivel



  #6  
Old April 21st 06, 09:25 AM posted to microsoft.public.outlook.program_vba
Vadivel
external usenet poster
 
Posts: 7
Default inconsistent in Redemption

Dmitry Streblechenko,

My machine has only outlook installed and does not have mapi profile. I
trying to get the smtp addresses of the stored .msg files(i have stored
..msg file in the local hard disk.) I am using visual basic for that.
The above code is working for some email ids and it does not work for
some email ids. is there any way to solve this.

Thanks
Vadivel

  #7  
Old April 21st 06, 07:44 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default inconsistent in Redemption

Sorry, I am even more confused than before - how do you use Outlook if it
does not have at least one profile?
Where do the MSG files come from?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vadivel" wrote in message
oups.com...
Dmitry Streblechenko,

My machine has only outlook installed and does not have mapi profile. I
trying to get the smtp addresses of the stored .msg files(i have stored
.msg file in the local hard disk.) I am using visual basic for that.
The above code is working for some email ids and it does not work for
some email ids. is there any way to solve this.

Thanks
Vadivel



  #8  
Old April 24th 06, 11:00 AM posted to microsoft.public.outlook.program_vba
Vadivel
external usenet poster
 
Posts: 7
Default inconsistent in Redemption

Hi,

I am storing the msg files manually.

Regards,
Vadivel

  #9  
Old April 24th 06, 07:54 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default inconsistent in Redemption

Do you mean by clicking "File | Save As" in Outlook? Or through some other
means?
Do you do that on the same machine? If yes, do you use the same MAPI profile
when saving and when restroring?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vadivel" wrote in message
oups.com...
Hi,

I am storing the msg files manually.

Regards,
Vadivel



  #10  
Old April 25th 06, 09:11 AM posted to microsoft.public.outlook.program_vba
Vadivel
external usenet poster
 
Posts: 7
Default inconsistent in Redemption

Hi,

All the emails (.msg files) stored in the FileNet document management
respository and i am getting it from FileNet repository and storing it
to local drive and parse the email. Now i am trying to get the email
ids of email.. So am not using mapi profile. I have just installed
outlook 2002 in my machine..

Thanks
Vadivel

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inconsistent events on same public calendar coginthemachine Outlook - Calandaring 1 April 1st 06 06:39 AM
Redemption Christoph Add-ins for Outlook 5 March 6th 06 04:26 PM
Inconsistent Calendar Info -- Design problem? Any Fixes? Toàn Outlook - Calandaring 0 February 14th 06 02:56 PM
How to set up a series of meetings with inconsistent dates? Drmyiz Outlook - Calandaring 0 January 30th 06 04:46 PM
Meeting invitation - inconsistent format JeremyCS Outlook - Calandaring 1 January 18th 06 11:04 PM


All times are GMT +1. The time now is 07:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.