jcpetu 4 Posted March 23, 2011 Hello all, I am trying to migrate some Outlook mail users from one address list to another. By now I managed to identify each address list and the corresponding entries, but I do not know how to get the mail address. I google to find out the object fields of mail address but even thought it does not bring mail address. Below is what I have. Any help will be appreciated. $oOApp=ObjCreate("Outlook.Application") If @error Or Not IsObj($oOApp) Then Exit $NameSpace = $oOApp.getnamespace("MAPI").addresslists ;Address book $AlistCount=$NameSpace.count ;Number of address lists For $i=1 to $AlistCount $NameSpace=$oOApp.getnamespace("MAPI").addresslists($i) $oAdrsEntry = $NameSpace.addressentries ConsoleWrite("Address list "&$i&"="&$NameSpace.name&"("&$oAdrsEntry.count&" items)"&@CRLF) ;get address list name & number of items Next $NameSpace=$oOApp.getnamespace("MAPI").addresslists(3) ; get access to the address list I need $oAdrsEntry = $NameSpace.addressentries ConsoleWrite("Name=" &$oAdrsEntry.item(3000).name & @CRLF & _ ; get info of particular entry "Address=" &$oAdrsEntry.item(3000).address & @CRLF & _ "Id=" &$oAdrsEntry.item(3000).id & @CRLF) Share this post Link to post Share on other sites
water 2,393 Posted March 23, 2011 Hi jcpetu, I'm not at my PC right now - I try to answer your question on saturday. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
jcpetu 4 Posted March 23, 2011 Hi jcpetu,I'm not at my PC right now - I try to answer your question on saturday.Thanks a lot Water, I will see the response on Monday because I wont be at my office by saturday. I really appreciate it.Have a good weekend. Share this post Link to post Share on other sites
water 2,393 Posted March 26, 2011 (edited) According to the Outlook Object Model Reference property "address" represents the email address.$oAdrsEntry.item(3000).addressIf this doesn't return the information you need then you could use methods GetContact, GetExchangeDistributionList or GetExchangeUser depending on the value of the AddressEntryUserType property. You then have access to the corresponding Outlook item.Example can be found here.BTW: In my signature you can find a link to the OutlookEX UDF (User Defined Functions) which has a lot of useful Outlook stuff. Edited March 26, 2011 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
jcpetu 4 Posted March 28, 2011 Thanks a lot water. I was testing the script under Win XP and other Outlook version and it works properly. It seems not to be working under Vista and Outlook 2007. I appreciate your help. Regards. Share this post Link to post Share on other sites
water 2,393 Posted March 28, 2011 (edited) I have run into problems too with Outlook versions after Outlook 2002 (I was testing the OutlookEX UDF on Windows XP and Outlook 2002). The next version of the UDF solves this problems plus adds functions to work with Address Lists. If you like to test I can send you the pre-release code by PM. Edited March 28, 2011 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
jcpetu 4 Posted March 28, 2011 Hi water, if you can send me the beta by pm I will test it and let you know. Thanks a lot and regards. Share this post Link to post Share on other sites