IanN1990

OutlookEX UDF -> Use different root folder

23 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi water,

Just tired it without the backlash but same error message.

 

Lastest UDF, just redownloaded from your page and Version 3.5.4 SciTE-Lite

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Same error i am afraid

Though in that example the error happens because of the _Ol_folderAccess Part and doesn't reach _Ol_folderTree

Edited by IanN1990

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I just ran the code again for some reason its not crashing gives the @error gives 2

Edited by IanN1990

Share this post


Link to post
Share on other sites

That's the error code of _OL_FolderAccess or _OL_FolderTree?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.

 

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Running your code the response is "Error creating folder tree. @error = 2, @extended = 4."

Hope you have a nice vacation :) This has no priority compared to that

Edited by IanN1990

Share this post


Link to post
Share on other sites

Is there anything else i can provide to help in troubleshooting?

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Sorry for the delay, it seams image uploading doesn't work in IE9.

I have include an image as request, please dont take offense to anything blanked out :)

 

Untitled.png

Share this post


Link to post
Share on other sites

Seams i am a idiot, i do apologize for all the trouble i have caused you.

_OL_FolderTree($oOutlook, "Configuration Admin") works :>

 

Share this post


Link to post
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