Jump to content
tempman

[solved] OutlookEX UDF - GAL (Global address list) full retrieve

Recommended Posts

tempman
Posted (edited)

Hi, with this script:

#include <outlookex.au3>
#include <array.au3>
Opt("MustDeclareVars", 0)

$oOL = _OL_Open()
$ListArray = _OL_AddressListGet($oOL)
$GalMembers = _OL_AddressListMemberGet($oOL, $ListArray[3][1])
_ArrayDisplay($GalMembers)

I can retrieve the entire list, but most of the columns is missing (Title, Location, Phone, ...)

Is it possible to retrieve all the clumns?
 

Edited by tempman

Share this post


Link to post
Share on other sites
water

I think you need to retrieve this additional properties by calling _OL_ItemGet for each element of the returned array (e.g. $GalMembers[$i][4]).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tempman

Thank you for the response, but I am lost in you answer...

What will be the value of $i? Should I need to use For loop?

Where to define that I want to retrieve Title GAL value?

Would you be so kind to implement your suggestion to my script?

Share this post


Link to post
Share on other sites
water

$i is the index of the array row you are processing in a loop.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tempman

I'm still sitting in the dark but thank you anyway...

Share this post


Link to post
Share on other sites
water

Something like this (untested):

#include <outlookex.au3>
Opt("MustDeclareVars", 0)
$oOL = _OL_Open()
$ListArray = _OL_AddressListGet($oOL)
$GalMembers = _OL_AddressListMemberGet($oOL, $ListArray[3][1])
For $i = 1 to $ListArray[0][0]
  $aProperties = _OL_ItemGet($oOL, $ListArray[$i][4], Default, "Title,Location,Phone")
  ; ... process properties of the item
Next

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tempman
Posted (edited)

Sorry for delay, I was OOF.

Unfortunately your OL_ItemGet script example didn't retrieve any column.
Look like it's only colums Name and Address are posible to retrieve...

Edited by tempman

Share this post


Link to post
Share on other sites
water

What is the value of @error and @extended?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tempman

There is no error (Exit code: 0) but no columns retrieve

If I modify outlookex.au3 Func _OL_AddressListMemberGet, by adding this line

$aMembers[$iIndex][4] = $aMembers[$iIndex][4].JobTitle

Only then i can retrieve Title in _ArrayDisplay($GalMembers)

Share this post


Link to post
Share on other sites
water

It's not the exit code (return value) I'm interested in but the value of the @error and @extended macro ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Test this one:

#include <outlookex.au3>
#include <Array.au3>

$oOL = _OL_Open()
_OL_ErrorNotify(2)
$aAddressLists = _OL_AddressListGet($oOL)
$aGALMembers = _OL_AddressListMemberGet($oOL, $aAddressLists[1][2]) ; <== Replace 1 with the index of your GAL in $aAddressLists
For $i = 1 To $aGALMembers[0][0]
    ; Exchange user that belongs to the same or a different Exchange forest
    If $aGALMembers[$i][2] = $olExchangeUserAddressEntry Or $aGALMembers[$i][2] = $olExchangeRemoteUserAddressEntry Then
        ConsoleWrite("Exchange: " & $aGALMembers[$i][4].Name & @CRLF)
        ; Address entry in an Outlook Contacts folder
    Else
        ConsoleWrite("No Exchangegroup: " & $aGALMembers[$i][1] & @CRLF)
    EndIf
    ;  Exitloop
Next
_OL_Close($oOL)

Properties for an Exchange UserAddressEntry can be found here: https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/exchangeuser-object-outlook

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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

×