Jump to content

OutlookEX UDF - Help & Support


Recommended Posts

@Mercury049

The problem you have seen is caused by the COM error handler established in function _AD_Open by the AD UDF.

When you call _OL_Open it tries to establish it's own COM error handler. But as the Active Directory COM error handler is still active the Outlook UDF can't.

Now we get a COM error in the Outlook UDF which then is handled by the AD COM error handler.

I have to investigate why we get the Outlook COM error at all.

This problem can be prevented by _AD_Close (as you did) or by changing the call to _OL_Wrapper_Sendmail to:

_OL_Wrapper_SendMail($oOutlook, "joe.blow@email.com", "", "", "DO NOT REPLY - TEST MESSAGE", $strEmailBody, "", $olFormatPlain)

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

Version 0.4.0 has been released.

Please test before using in production!

For download please see my signature.

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

  • 2 weeks later...

Hi Water, many thanks for your UDF. Its a great tool.

But i'm missing one thing and cannot find it in 0.3.0 and 0.4.0. How do i get a listing of all items contained in one single folder? Such a function like _ol_ItemList($oOL,$olFolder)? Did i have to use _OL_ItemFind (which is the only function that seems to cover this point)? All *List functions available only covers addresses and distribution lists.

Regards,

Thomas

Link to comment
Share on other sites

Hi Dschingis,

you are correct. The _OL_ItemFind function is what you need.

Unfortunately you have to specify the objectclass you want to get listed. If a folder type can hold multiple objectclasses (a contact folder can hold contacts and distribution lists) you have to call _OL_ItemFind twice.

This is true because every objectclass has a different set of properties. So to search for or return properties the objectclass has to be specified.

Edited by water

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

Hi Water,

many thanks for your answer. It cost me a bit time to bite me through but now i had a breakthrough. With the line

$aItems = _OL_ItemFind($oOutlook, "*", $olMail, "", "", "", "SenderName,Subject,Body,ReceivedTime", "", 1)

which i took and modified from your ItemFind example i am able to list the whole complete default folder (my Mailbox) and show me every mail there. Now i am working on changing that to my personal folders as well. I will come back to you with more questions :mellow: .

Thomas

Link to comment
Share on other sites

... It cost me a bit time to bite me through but now i had a breakthrough ...

Hi Dschingis,

If you need more documentation or better/more examples please tell me and I will do my very best to enhance the UDF.

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

Hi Water,

many thanks for your offer. I will take you by your word. Here is a new point i stumpled upon. While working with the _OL_FolderTree and _OL_ItemFind functions on Windows XP and Office 2007 i discovered i cannot use the total path delivered by _OL_FolderTree to access Outlook folders. Instead i had to cut the leading two backslashes to get it to work. According to your documentation in OutlookEx.au3 UDF this should make no difference in _OL_FindItem. Any ideas?

Global $oOutlook = _OL_Open(),$array1,$array2,$i

$array1= _OL_FolderTree($oOutlook, "*")
If IsArray($array1) Then
    _ArrayDisplay($array1,"Folderlist")
    For $i = 1 to UBound($array1) - 1
        $array2 = _OL_ItemFind($oOutlook, CutFirstTwoChars($array1[$i]), $olMail, "", "", "", "EntryID,SenderName,Subject,CreationTime", "", 4)
        If IsArray($array2) Then
            _ArrayDisplay($array2, "Mails in Folder " & CutFirstTwoChars($array1[$i]))
        Else
            ConsoleWrite("Folder " & CutFirstTwoChars($array1[$i]) & " contains " & $array2 & " mail items." & @LF)
        EndIf
    Next
EndIf

Func CutFirstTwoChars($a)
    ; Return $a
    Return StringRight($a,StringLen($a) - 2)
EndFunc
Link to comment
Share on other sites

Hi Dschingis,

according to the description in _OL_FolderAccess (which is called by _OL_ItemFind under the covers) the folderpath you get from _OL_FolderTree is used to access a "subfolder of the default folder of another user (class specified by $iOL_FolderType)".

You can shorten the removal of the first 3 characters to "StringMid($array1[$i]), 3)".

It looks like this was a bad design decision so the folderpath can not directly be used.

Now it is:

"\\firstname name\subfolder\...\subfolder" subfolder of the default folder of another user (class specified by $iOL_FolderType)

"\\firstname name\\subfolder\...\subfolder" subfolder of another user

Should we change it to:

"\\firstname name\\subfolder\...\subfolder" subfolder of the default folder of another user (class specified by $iOL_FolderType)

"\\firstname name\subfolder\...\subfolder" subfolder of another user

How many scripts would this break?

Edited by water

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

Oh, i've started an avalanche :mellow:

It looks like this was a bad design decision so the folderpath can not directly be used.

Water, i am sure this UDF had grown over a long time so some changes in design are normal :) Imho every function which uses paths should use the same format. As here the path delivered by FolderTree should be directly usable for all and every function. The path returned by i.e. [mailitemobject].Parent should also be usable in ItemMove, etc. If different path formats are necessary for the objects the wrapper should take care of that, i.e. converting them from one format to another.

Should we change it to:

I am used to the path designs of Windows and Un*x so i am tending to prefer the design where \\ means the root of every mailbox or container. So any path should start with either an * or a double backslash and my favorite is
\\firstname name\top-level-subfolder\subfolder\..\..\..
for basic access to any folder regardless of me or another user. When i read the docs i understand * (a star char) is equivalent to
\\MyFirstName MyName
which is my own root folder, i.e. i can use
*\ClusterInfo
for one top level subfolder of my own mailbox. In general i'd be happy with absolute paths for all and every occasion.

Any comments?

Link to comment
Share on other sites

Oh, i've started an avalanche :mellow:

No, just a design discussion.

Water, i am sure this UDF had grown over a long time so some changes in design are normal :)

We started to work on this UDF in march. It's a complete rewrite of the existing Outlook UDF. Therefore the name was changed to OutlookEX (for extended).

Imho every function which uses paths should use the same format. As here the path delivered by FolderTree should be directly usable for all and every function.

D'accord. To make the format returned by folderpath work for every function I need to change the way a path is interpreted.

I will change the meaning of the second \\ (marked in red in my previous post).

All functions use a folder object to access the folder which is returned by _OL_FolderAccess. _OL_FolderAccess itself interprets the foldername you specify as paramter. This interpretation will be changed so folderpaths will work the way you woul like it to work.

I hope this doesn't break too many scripts!

I'm on vacation for at least one week and will think about it with a glass of french red wine in one and some of the local food in the other hand :)

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

Hello, I am currently working with a modified Outlook.au3 and ran across your UDF. I am stumped on deleteing a contact. Can anyone give me an example of how this UDF does that? Thanks...

Okay, I figured it out myself, with this awesome UDF...

#include <OutlookEX.au3>

$oOL = _OL_Open()

Global $aFolder = _OL_FolderAccess($oOL, "", $olFolderContacts)

$varArray = _OL_ItemFind( $oOL, $aFolder[1], $olContact, '[FullName] = "John Doe"', "", "", "EntryID")

_OL_ItemDelete($oOL, $varArray[1][0], "")

Edited by Jaboowaki
Link to comment
Share on other sites

Hi water,

we are currently changing from outlook2003 to 2010 and there are many users who have pst files in use. Is there a way to add a pst file to the new created 2010 profile? So when the user starts outlook 2010 the first time he has directly all the old pst files from his outlook 2003.

Is there some kind of 'object' to accomplish this task?

thx in advance

Sundance from cloudy germany

Link to comment
Share on other sites

Yes, _OL_PSTAccess should do what you need.

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

:mellow:

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

How would you search for a contact by CompanyName and FullName?

$aEntryID = _OL_ItemFind( $oOutlook, $aFolder[1], $olContact, "", "CompanyName,FullName", $CompanyName&","&$FullName, "EntryID" )

The _OL_ItemFind.html file provided with the ZIP file explains how to create a query.

$aEntryID = _OL_ItemFind( $oOutlook, $aFolder[1], $olContact, "[CompanyName]='Name of the Company' And [FullName]='Fullname you search for'", "", "", "EntryID" )

I think the Wiki needs an extended description and some good examples :graduated:

Edited by water

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

What do you mean by "read"? Find a mail filtered by subject, sender or whatever? Display a mail?

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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