Jump to content

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


Recommended Posts

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
Link to comment
Share on other sites

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 (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

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?

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

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 (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

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
Link to comment
Share on other sites

What is the value of @error and @extended?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

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)

Link to comment
Share on other sites

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 (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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...