![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
Hi,
I am storing the msg files manually. Regards, Vadivel |
#9
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |