Jump to content

Outlook address book mail address


Recommended Posts

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)

Link to comment
Share on other sites

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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

According to the Outlook Object Model Reference property "address" represents the email address.

$oAdrsEntry.item(3000).address

If 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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...