Jump to content

OutlookEX UDF - Help & Support (IV)


water
 Share

Recommended Posts

43 minutes ago, water said:

You mean the script exits when the your laptop hibernates?

No, the script remains "active" when the laptop hibernates. There is no hook to close on hibernate. --> Which may be a very simple solution.

 

 

It also means Outlook should always be open BEFORE starting the script...

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

There is no reason to start Outlook before you start your script.
As long as there is an open reference to an Outlook item Outlook does not get closed automatically when started with OL_Open. Details can be found in the MSDN article which is referenced in the wiki article for OutlookEX.

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

  • 4 weeks later...

Erm :) Hello @water Could you help me a bit plz ? 

I think I have some difficulties to understand how outlook setup my test environment.  For some reason he does not want to make a new profil with "classic" setup. 

 

I don't want to manage this, so I'm in the way to make a new script to help my colleagues. But you helped me long time ago about this snippet of code : (I commanted ect to remember later) 

 

#include <OutlookEX.au3>
#include <Array.au3>


;Connexion outlook.
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailheaderGet Example Script", "Error connecting to Outlook. @error = " & @error & ", @extended: " & @extended)


;Connexion InBox
Global $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderInbox)
$aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "", "", "", "EntryID,Subject", "", 1)
If Not IsArray($aItems) Then Exit MsgBox(48, "", "@error = " & @error & ", @extended: " & @extended)

;Getting last header
$LastEntry = UBound ($aItems)
$LastEntryLessOne = $LastEntry-1
_ArrayDisplay($LastEntryLessOne)
_ArrayDisplay($aItems)
$HeaderLastEntry = $aItems[$LastEntryLessOne][1]

;Msging last header
MsgBox(0,"",""&$HeaderLastEntry)

 

My "non classic" setup give me troubles : (see screen) 

image.png.bf7ac3f9714531c115cedd43333a0dc7.png

for some reasons the new setup make a pst data file into a new account and then adding my gmail account into a second mail box insteed of using the only email as principal. Well no need to try to solve that if you could learn me how to change the readed account. Before asking like always I checked the htm file but I can't rly understand how to do that. 

 

This is where I have to work right ? _OL_FolderAccess

Thanks !

EDIT : 

AutoAnswer : Was playing arround with the function and your error message leaded me on the good way. 

Solved with : Global $aFolder = _OL_FolderAccess($oOutlook, "USERNAMEOFEMAIL@gmail.com", $olFolderInbox)

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

So that make me confused. 

The old snippet does not work anymore :(

 

Or should I say it work but not as I want.

 

The arrays show me I think all my inbox it's ok but I can't see the last email received. 

 

Not at first row or last either

image.png.0fbbd861a51addfa5f66c5b5df1c3c4d.png

image.png.a517ba3dd825c91c410dec6f5f5d76c5.png

 

image.png.d195969cad4b950c86a1e1c95624bb1e.png

 

3 things

-The last entry is now the last email and not the last received. (Solved)  

-Also If I want to reduce the return to 50 email maximum this is possible ?

-Why the orders of email are no more right ? (Solved)  

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

14 hours ago, caramen said:

Also If I want to reduce the return to 50 email maximum this is possible ?

Not at the moment. The function returns all records it finds.
Why do you want to limit the number of records returned? Performance reasons?

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

6 hours ago, water said:

Performance reasons

Yap :) 

The goal is to check the inbox each 2-3 sec to see if there is a new mail, and then do actions depends on the content. And if there is no way to improve the speed it will change all my development previsions. It is actually 15-18 sec to get the 3000 items. I can have 2 3 4 5 6 row from _OL_ItemFind it does not change anything in perf or I don't see it.

If the script do action then tag the mail with "folow flag" Or "Color" <- Btw if you can lead me to do that too. (and I tried during 2 hours yesterday I don't did all my test yet, so I will come later If I don't get how to do, I think it's _OL_ItemModify but I didn't check all function yet (consulting Microsoft website is a bit hard for me too because the jargon is not same, object, attribut etc...) ) 

I take the lead of a new team, and I want to free the guy who is busy on emails to give him better work to do. 😎

 

If I can't do that in 3 seconds I will need to add a GUI to select a mail from all mails scanned and that will need human control.

If I can do that in 3 sec I will just check each 2-3 seconds./ So I can check all emails with that without a human control which is very better for my goal.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Events should be used to act on arriving mails. Please check this thread:

 

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

Here you find a good desription on how to set the follow up flag.

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

27 minutes ago, water said:

Events should be used to act on arriving mails. Please check this thread:

Rly interesting, that totally change my vision of what I'm going to do. 

 

It is maybe not the place to ask thing like that, I don't want to bother you, you probably busy doing your task as well. Could you give me light on what is the EntryID, I mean in our case we use the EntryID of the mail box, is that right ?

 

Each items got EntryID mean BOX got ID and mails got ID too ? exactly same as active directory SSID ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

EntryID is the unique identifier of mail, contacts, folder... items. A store has a unique StoreID.

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

  

19 minutes ago, water said:

Here you find a good desription on how to set the follow up flag.

Oh wow wait, there is not any easier way to affect the arrival mails with anything everyone can see without adding VB ?(I think this is to add task)

Maybe I gave you wrong info the flag for me is the follow flag this : image.png.c59f77532bc549b09a6913cf3df01b49.png

 

And after check I could say I'm probably going to use this : image.png.83a7fa3f8e47c31ab9ebd9dc4854987c.png

With : _OL_CategoryAdd

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

18 hours ago, caramen said:

_OL_CategoryAdd

I'm whrong I don't get how to simply flag an email. I got the EntryID of the item I want to flag. I don't find any function to do so.

 

Quote

$oItem = _OL_ItemModify ($oOutlook, $EntryID, "Default", "Categories=Catégorie Bleu")

I think I'm close

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Run _OL_CategoryGet to get a list of categories.
Then use _OL_ItemModify to set the category as you did in your example.
If it doesn't work please post the values of @error and @extended.

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

2 hours ago, water said:

Run _OL_CategoryGet to get a list of categories.
Then use _OL_ItemModify to set the category as you did in your example.
If it doesn't work please post the values of @error and @extended.

As you expected. 

 

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.5
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <OutlookEX.au3>
#include <Array.au3>

Global $aItems

;Connexion outlook.
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailheaderGet Example Script", "Error connecting to Outlook. @error = " & @error & ", @extended: " & @extended)


;Connexion InBox

Global $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderInbox)
_ArrayDisplay($aFolder)

;EntryID , Sender , Body
$aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1)
If Not IsArray($aItems) Then Exit MsgBox(48, "", "@error = " & @error & ", @extended: " & @extended)

$EntryID = $aItems[1][4]
_ArrayDisplay($aItems)

;Msging the array

$HeaderLastReceived = $aItems[1][2]

MsgBox(0,"",""&$aItems[1][0])
MsgBox(0,"",""&$aItems[1][1])
MsgBox(0,"",""&$aItems[1][2])
MsgBox(0,"",""&$aItems[1][3])
MsgBox(0,"",""&$aItems[1][4])

$oCatList = _OL_CategoryGet ($oOutlook)
_ArrayDisplay($oCatList)

$oItem = _OL_ItemModify ($oOutlook, $EntryID, "Default", "Categories=Blue" , "Subject=Test")

_OL_Close($oOutlook)

_ArrayDisplay($oCatList)

image.png.6582fe06458e59009ccc24c87583f0f3.png

Blue exist

image.png.06ab5ad740795522f20711f5b08481bb.png

 

And it is POP account.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

$oItem = _OL_ItemModify ($oOutlook, $EntryID, "Default", "Categories=Blue" , "Subject=Test")

needs to be

$oItem = _OL_ItemModify ($oOutlook, $EntryID, Default, "Categories=Blue" , "Subject=Test")

What is the value of @error and @extended after you call _OL_ItemModify?

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

it work without brackets :) thanks bro

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

nvm

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Hello @water It's me again 😕

I'm getting stuck. 

I'm trying to understand how to move an item. 

 

I'm confused between : Store and Folder

for example, actually I'm trying to do an array display of SubFolder1 item(s) This doesn't work and I know this is my fault :

What I do wrong please ?

 

$oBoite = "******@hotmail.com"

$oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection à Outlook. @error = " & @error & ", @extended: " & @extended)

$tFolder = _OL_FolderTree($oOutlook, "*")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing root folder. @error = " & @error)
;~ $aFolder = _OL_FolderAccess($oOutlook, $oBoite, "SubFolder1" )
;~ $aFolder = _OL_FolderAccess($oOutlook, $oBoite, $olFolderInbox)
$aFolder = _OL_FolderAccess($oOutlook, $oBoite, $tFolder[3] )
    If Not IsArray($aFolder) Then MsgBox (0,0,"pas d'accès" & @CRLF & "@error = " & @error & ", @extended: " & @extended)
$aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 0 )
    If Not IsArray($aItems) Then MsgBox(48, "", "Pas de mail trouvé" & @CRLF & "@error = " & @error & ", @extended: " & @extended)


_ArrayDisplay($tFolder)
_ArrayDisplay ($aFolder)
_ArrayDisplay ($aItems)

My second question is

$oOutlook = _OL_Open()
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection à Outlook. @error = " & @error & ", @extended: " & @extended)
$aFolder = _OL_FolderAccess($oOutlook, $oBoite, $olFolderInbox)
    If Not IsArray($aFolder) Then MsgBox (0,0,"pas d'accès" & @CRLF & "@error = " & @error & ", @extended: " & @extended)
$aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1 )
    If Not IsArray($aItems) Then MsgBox(48, "", "Pas de mail trouvé" & @CRLF & "@error = " & @error & ", @extended: " & @extended)

_ArrayDisplay ($aFolder)
_ArrayDisplay ($aItems)

This sample work nice. But If I change the last parameter of _OL_ItemFind to 0 regarding your documentation I should do same without subfolder in my matches. But nop, if I do so, My Arrays is empty :( But my inbox contain 1800 items. 

Well while I'm writing this I realize my inbox is probably a folder so ? If I solve my first problem I will solve this one does I'm right ?

 

image.png.7da1bc63a7a063e6d9185c848445e65e.png

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

In short: A Store is the parent object of folders like mail, calendar etc. A store can reside on Exchange, in a local PST file or it can connect to a gmail account.
When you check the parameters for _OL_FolderAccess you will see that it doesn't ask for a store. The store is the first part of the folderaddress e.g. "Boîte the réception\SubFolder1".

To make sure you grab any errors and know which error occurred please check the value o @error and @extended after calling a _OL_* function or add

_OL_ErrorNotify(2)

at the top of your script ater _OL_Open to get detailed error description.

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 @water So I made this reproducer 

_OL_ErrorNotify(2)

Global $oBoite = ""
;~ $oBoite = "*********@hotmail.com"
$oBoite = "Contact@web-********.com"

Global $oItem , $oOutlook , $aFolder , $oStoreID , $aItems , $EntryID
Global $nMsg , $cHeight , $iRow , $aResult , $aFolder2 , $aItems2


$oOutlook = _OL_Open()
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection à Outlook. @error = " & @error & ", @extended: " & @extended)


$aFolder = _OL_FolderAccess($oOutlook, $oBoite, $olFolderInbox)
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection aux dossiers Outlook. @error = " & @error & ", @extended: " & @extended)
_ArrayDisplay ($aFolder , "$aFolder")

$aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1 )
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection aux items Outlook $aItems. @error = " & @error & ", @extended: " & @extended)
_ArrayDisplay ($aItems, "$aItems")

$aResult = _OL_FolderTree($oOutlook, $aFolder[1] )
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur d'arbo. @error = " & @error & ", @extended: " & @extended)
_ArrayDisplay ($aResult, "$aResult")

$aFolder2 = _OL_FolderFind( $oOutlook , $aFolder[1] , 99 , "Test12345" )
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur Dossier introuvable folderfind. @error = " & @error & ", @extended: " & @extended)
_ArrayDisplay ( $aFolder2, "$aFolder2")
Global $DEBUG2 = MsgBox(0,0,"DEBUG2 :" & $aFolder2[1][0] )
Global $DEBUG3 = MsgBox(0,0,"DEBUG3 :" & $aFolder2[1][1] )
Global $DEBUG4 = MsgBox(0,0,"DEBUG4 :" & $aFolder2[1][2] )


$aItems2 = _OL_ItemFind($oOutlook, $aFolder2[1][2], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1 )
    If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection aux items Outlook $aItems2. @error = " & @error & ", @extended: " & @extended)
_ArrayDisplay ($aItems2, "$aItems2")

First unexpected use of return 

--- $aItems = _OL_ItemFind = "" <- The row 1 of $aFolder is empty ? 

(I would have expect to use $aFolder[3] to have the right return in $aItems but nop it only work as expected with $aFolder[1])
3 - StoreID (string) of the store to access the folder by ID

image.png.3697f268a55d0c811dfe9328c79a8991.png

second unexpected return 

--- $aResult use the same variable of _OL_ItemFind which is returning contact@************

But still $aResult return to me the results of hotmail account. 

Corrected. Reproducer Edited

image.thumb.png.fc38b7bbaeb31bf01a1382804e01abbe.png

 

Now I thought I was OK but no : $DEBUG4 = Test12345 

 

$aItems2 = @Error : 

image.png.4eba51a0c2d5ed9ecbc2742bbb804d64.png

image.png.cb078c0946d1b20d282b0a3d88fe3afb.png

 

image.png.964f20dd81851c2b7d2a50c8658476fe.png

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

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

×
×
  • Create New...