#include ; ***************************************************************************** ; Open Outlook instance ; ***************************************************************************** Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ; List all adress lists ; ***************************************************************************** $aResult = _OL_AddressListGet($oOutlook, False) If @error <> 0 Then _ Exit MsgBox(16, "OutlookEX UDF: _OL_AddressListGet Example Script", "Error " & @error & " when listing all address lists!") _ArrayDisplay($aResult, "OutlookEX UDF: _OL_AddressListGet Example Script - All address lists", "", 0, "|", "OlAddressListType|Name|Index|Resolving order|Identifier") ; Keep list who contains the word Local $sSearchList="SAS" If IsArray($aResult) Then Local $index=_ArraySearch($aResult, $sSearchList, 0, 0, 0, 1, 0) If @error Then MsgBox($MB_SYSTEMMODAL, "Not Found",$sSearchList & " was not found") Else MsgBox($MB_SYSTEMMODAL, "Found", $sSearchList & "was found in the array at position " & $index ) ; Get all List members with my var $sSearchList filter $aResult = _OL_AddressListMemberGet($oOutlook, $aResult[$index][1]) If @error <> 0 Then _ Exit MsgBox(16, "OutlookEX UDF: _OL_AddressListMemberGet Example Script", "Error " & @error & " gettings members of first address lists!") _ArrayDisplay($aResult, "OutlookEX UDF: _OL_AddressListMemberGet Example Script - All members of the first address list", "", 0, "|", "EMail address|Name|OlAddresEntryUserType|Identifier|Object of the address entry") EndIf EndIf _OL_Close($oOutlook)