water Posted September 10, 2013 Author Share Posted September 10, 2013 In function oItems_ItemAdd check the property Class for mails: If $oOL_Item.Class = $olMail Then ; process the mail EndIf 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 More sharing options...
SkoubyeWan Posted September 11, 2013 Share Posted September 11, 2013 Thank you! That worked. Link to comment Share on other sites More sharing options...
water Posted September 11, 2013 Author Share Posted September 11, 2013 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 More sharing options...
gcue Posted September 13, 2013 Share Posted September 13, 2013 how can i get the members of a shared distribution list? i see the example shows how to get it for local contact distribution lists.. how can i figure out the path for the server distribution list? thanks again water! $distribution_list = "Meeting Call" $oOutlook = _OL_Open() $item = _OL_ItemFind($oOutlook, "*\Global Address List", $olDistributionList, $distribution_list, "", "", "EntryID") debug($item) $members = _OL_DistListMemberGet($oOutlook, $item) _OL_Close($oOutlook) debug($members) Func Debug($variable1 = "", $variable2 = "", $variable3 = "") If IsArray($variable1) Then _ArrayDisplay($variable1) Else If $variable2 <> "" Then $variable1 &= @CRLF & $variable2 EndIf If $variable3 <> "" Then $variable1 &= @CRLF & $variable3 EndIf ClipPut($variable1) MsgBox($msg_normal, "Debug", $variable1) EndIf EndFunc ;==>Debug Link to comment Share on other sites More sharing options...
water Posted September 13, 2013 Author Share Posted September 13, 2013 Function _OL_AddressListGet returns the list of all address lists. Column 1 of the returned array returns the type of the address list. Your example doesn't work because _OL_ItemFind always returns an array. 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 More sharing options...
gcue Posted September 13, 2013 Share Posted September 13, 2013 ok looks like global address list is correct. debug function shows arrays ;-) however i dont get any results from the itemfind - i think the path is correct right? *Global Address List i've used *Contacts before and it seems to be at the same hierarchy.. Link to comment Share on other sites More sharing options...
water Posted September 13, 2013 Author Share Posted September 13, 2013 The search parameter is wrong: Has to be of format property=value. You should try "Name=Meeting Call" 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 More sharing options...
gcue Posted September 13, 2013 Share Posted September 13, 2013 getting "object could not be found" error in console.. hmm how can i find out if thats the right property? i also tried DisplayName and AliasName - since i saw those in the properties window Link to comment Share on other sites More sharing options...
water Posted September 14, 2013 Author Share Posted September 14, 2013 This script should return the names of all members of your distribution list: #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $sDLName = "Meeting Call" Global $aRecipient = _OL_ItemRecipientCheck($oOutlook, $sDLName) If @error Then Exit MsgBox(16, "OutlookEX UDF", "Addresslist not found. @error = " & @error & ", @extended = " & @extended) Global $oDLM = $aRecipient[1][3].GetExchangeDistributionListMembers() For $iIndex = 1 To $oDLM.Count ConsoleWrite($oDLM.Item($iIndex).Name & @LF) Next _OL_Close($oOutlook) Looks like I need to enhance function _OL_DistListMemberGet. 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 More sharing options...
gcue Posted September 16, 2013 Share Posted September 16, 2013 (edited) yep works great! thank youu! let me know if you want me to test your enhancement =) Edited September 16, 2013 by gcue Link to comment Share on other sites More sharing options...
water Posted September 16, 2013 Author Share Posted September 16, 2013 (edited) You already did! This functionality will become part of the next version of the UDF! Here is the new extended function: _OL_DistListMemberGet.au3 Edited September 16, 2013 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 More sharing options...
gcue Posted September 16, 2013 Share Posted September 16, 2013 hmm actually doesnt seem to work when i use a bogus DL name - get this crash error bject referenced outside a "With" statement.: $oDLM = $aRecipient[1][3] .GetExchangeDistributionListMembers() $oDLM = $aRecipient[1][3] ^ ERROR Link to comment Share on other sites More sharing options...
water Posted September 16, 2013 Author Share Posted September 16, 2013 Did you call _OL_ItemRecipientCheck to verify that the recipient exists? 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 More sharing options...
gcue Posted September 16, 2013 Share Posted September 16, 2013 You already did! This functionality will become part of the next version of the UDF! Here is the new extended function: cool! ill wait till it comes out in the udf =) like your ad function this should come built in with autoit - super useful and im sure widely used. thank you so much for your efforts creeating, maintaining, and supporting!! Link to comment Share on other sites More sharing options...
gcue Posted September 16, 2013 Share Posted September 16, 2013 Did you call _OL_ItemRecipientCheck to verify that the recipient exists? yes thats the error i dont think it captures $sDLName = InputBox($script_name, "Enter Distribution List Name:", "", " M", 300, 130) If @error = 1 Then Return $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox($msg_error, $script_name, "Error creating a connection to Outlook.") $aRecipient = _OL_ItemRecipientCheck($oOutlook, $sDLName) If @error Then Exit MsgBox($msg_error, $script_name, "Distribution list not found. @error = " & @error & ", @extended = " & @extended) $oDLM = $aRecipient[1][3] .GetExchangeDistributionListMembers() For $iIndex = 1 To $oDLM.Count ConsoleWrite($oDLM.Item($iIndex).Name & @LF) Next _OL_Close($oOutlook) Link to comment Share on other sites More sharing options...
water Posted September 16, 2013 Author Share Posted September 16, 2013 Can you add the function I posted above to your script, rename it to _OL_DistlistMemberGetEX and call it with a bogus DL? 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 More sharing options...
gcue Posted September 16, 2013 Share Posted September 16, 2013 (edited) hmm i tried adding it to my script but didnt work bc dupped function being called so i replaced it in the udf... doesnt seem to be working even with a valid DL Name error: parameter is incorrect $sDLName = InputBox($script_name, "Enter Distribution List Name:", "", " M", 300, 130) If @error = 1 Then Return $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox($msg_error, $script_name, "Error creating a connection to Outlook.") $members = _OL_DistListMemberGet($oOutlook, $sDLName) _OL_Close($oOutlook) _ArrayDisplay($members) Edited September 16, 2013 by gcue Link to comment Share on other sites More sharing options...
water Posted September 16, 2013 Author Share Posted September 16, 2013 (edited) I extended the example and it works just fine: _OL_DistListMemberGet.au3 Edited September 16, 2013 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 More sharing options...
gcue Posted September 16, 2013 Share Posted September 16, 2013 hmm i think its because im not using the correct vItem? i also tried referencing the dist list with $aRecipient = _OL_ItemRecipientCheck($oOutlook, $sDLName) $members = _OL_DistListMemberGet($oOutlook, $aRecipient) Link to comment Share on other sites More sharing options...
water Posted September 16, 2013 Author Share Posted September 16, 2013 The key is this line: If @error Or $aRecipient[0][0] = 0 Or $aRecipient[1][1] = False Then Exit MsgBox(16, "OutlookEX UDF", "Addresslist not found or not unique. @error = " & @error & ", @extended = " & @extended) If there is an error No recipient was returned the recipient could not be resolved (invalid recipient, recipient is not unique) then the error message is displayed and the script ended. 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 More sharing options...
Recommended Posts