Jump to content

OutlookEX UDF -> Use different root folder


Recommended Posts

Hi,

I recently gained access to a shared mailbox within my team. Previously my work would only search the users inbox for information, but now i have a group one this will everything faster and easier for me to maintain (As i only need to look after one box, rather then depend on people having their boxes correctly) but i am run into a problem.

#include <OutlookEX.au3>
Global $oOutlook = _OL_Open()

;Example 1 Works
$aResult = _OL_FolderTree($oOutlook, "*")
_ArrayDisplay($aResult, "Shows my folder structure")

;Example 2 Works
$aResult = _OL_FolderTree($oOutlook, "ian.name@company.com\")
_ArrayDisplay($aResult, "Shows my folder structure")

;Example 3 fails
$aResult = _OL_FolderTree($oOutlook, "Configuration.Admin@company.com\")
_ArrayDisplay($aResult, "Fails")


;"\\office.local\DFSroot2$\UserHome6$\Ian.Name\profile\Desktop\EUC Automation\3ƠPrograms\AutoIt3\Include\OutlookEX.au3" (1269) : ==> The requested action with this object has failed.:
;$oFolder = $oNamespace.Folders($aFolders[1])
;$oFolder = $oNamespace^ ERROR

As always now, i research before posting but it doesn't not many people are trying to do what i do.

I found the wiki Page

https://www.autoitscript.com/wiki/OutlookEX_UDF_-_General#Folders

 

"rootfolder\subfolder\...\subfolder" any public folder or any folder of the current user (replace rootfolder with * to access the root folder of your mailbox)
"\\firstname name" default folder of another user (class specified by $iOL_FolderType) (replace "firstname name" with "*" to access your mailbox)
"\\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
"" default folder of the current user (class specified by $iOL_FolderType)
"\subfolder" subfolder of the default folder of the current user (class specified by $iOL_FolderType)

 

but searching though the .au3 i cant find any reference to $iOL_FolderType.

So where am i going wrong? I can confirm i have access to the mailbox as i can use it.

Ian

 

 

Edited by IanN1990
Link to comment
Share on other sites

Did you try

$aResult = _OL_FolderTree($oOutlook, "Configuration.Admin@company.com") ; Notice that I removed the trailing backslash

 

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

Which version of AutoIt do you run?
Which version of the OutlookEX UDF do you run?

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

Can't test at the moment but I think it should work this way:

Global $aFolder = _OL_FolderAccess($oOutlook, "Configuration.Admin@company.com", $olFolderInbox)
Global $aResult = _OL_FolderTree($oOutlook, $aFolder[1])
_ArrayDisplay($aResult)

 

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

OK. This means I need to check as soon as I return to my office. Please stay tuned.

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

I tested with a public folder and it works the way you did in your first post.
Could you please run the following script so we are sure there is no old version of the UDF flying around?

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

MsgBox(0, "AutoIt version", " AutoIt version: " & @AutoItVersion)
Global $aVersion = _OL_VersionInfo()
_ArrayDisplay($aVersion)

Global $aResult = _OL_FolderTree($oOutlook, "Configuration.Admin@company.com")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating folder tree. @error = " & @error)
_ArrayDisplay($aResult)

_OL_Close($oOutlook)

Please post the result of the MsgBox and the _ArrayDisplay.

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

Autoit Version 3.3.14.2
 

V

1

1

0

20160720

3.3.10.2

wooltown, water

progandy (CSV functions), Ultima, PsaltyDS (base of the __OL_ArrayConcatenate function)
 

$oFolder = $oNamespace.Folders($aFolders[1])
$oFolder = $oNamespace^ ERROR

 

 

Edited by IanN1990
Link to comment
Share on other sites

That's the error code of _OL_FolderAccess or _OL_FolderTree?

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

BTW:
Can you please download the latest version (1.2.1.0) of the OutlookEX UDF? COM error handling has been improved!

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

The @error was the code proved

On 20 August 2016 at 8:43 AM, water said:

I tested with a public folder and it works the way you did in your first post.
Could you please run the following script so we are sure there is no old version of the UDF flying around?

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

MsgBox(0, "AutoIt version", " AutoIt version: " & @AutoItVersion)
Global $aVersion = _OL_VersionInfo()
_ArrayDisplay($aVersion)

Global $aResult = _OL_FolderTree($oOutlook, "Configuration.Admin@company.com")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating folder tree. @error = " & @error)
_ArrayDisplay($aResult)

_OL_Close($oOutlook)

Please post the result of the MsgBox and the _ArrayDisplay.

The @error = 2 was produced by this code (though i changed the @company to my companyname).

 

I also went into OutlookEX and copied this

; #INDEX# =======================================================================================================================
; Title .........: Microsoft Outlook Function Library (MS Outlook 2003 and later)
; AutoIt Version : 3.3.10.2
; UDF Version ...: 1.2.1.0

 

So it is the lastestv ersion from your download page. I ensured it is being used by adding Msgbox(0, "Test", Test") and re-ran to script (the msgbox appeared) so it is being used.

 

Link to comment
Share on other sites

In this case we need to extend the error message we get:

If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating folder tree. @error = " & @error & ", @extended = " & @extended)

I will be on vacation for a week now. So my responses will slow down till next Sunday.

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

Could you please post (or PM) a screenshot of the Outlook folder pane (at least the part with the root you want to access).

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

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

  • Recently Browsing   0 members

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