Jump to content

OutlookEX UDF - Help & Support (II)


water
 Share

Recommended Posts

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

:D

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

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

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

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

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

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

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

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

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

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

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

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

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

I extended the example and it works just fine:

_OL_DistListMemberGet.au3

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

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

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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