Jump to content

OutlookEX.au3 issue


TheOne23
 Share

Recommended Posts

Hi Everyone,

i would like to ask your assistance to check the issue on outlookex.au3.

my script before was running smoothly but as of today I got error while running it.

Below is the script i am having issues with outlookex.au3

Attached is the actual error from outlookex.au3

 

Your help will be greatly appreciated.

#include <OutlookEX.au3>
#include <Array.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 $aOL_Item = _OL_ItemFind($oOutlook, "RonaldJayson_paggao@comcast.com\Inbox\BP_automation", $olMail, "[UnRead]=True", "", "", "EntryID,body,receivedtime,senderemailaddress", "", 2)
_ArrayDisplay($aOL_Item) ; This code was working before but today it has an issue and error.

Global $aOL_Item = _OL_ItemFind($oOutlook, "RonaldJayson_paggao@comcast.com\Inbox\BP_automation", $olMail, "[UnRead]=True", "", "", "EntryID,Subject", "", 2)
_ArrayDisplay($aOL_Item) ; this code works but i need to use the previouse code with item properties "EntryDI,body,receivedtime,senderemailaddress"

 

error.PNG

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support forums.

Moderation Team

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Hi Everyone,

i would like to ask your assistance to check the issue on outlookex.au3.

my script before was running smoothly but as of today I got error while running it.

Below is the script i am having issues with outlookex.au3

Attached is the actual error from outlookex.au3

 

Your help will be greatly appreciated.

#include <OutlookEX.au3>
#include <Array.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 $aOL_Item = _OL_ItemFind($oOutlook, "RonaldJayson_paggao@comcast.com\Inbox\BP_automation", $olMail, "[UnRead]=True", "", "", "EntryID,body,receivedtime,senderemailaddress", "", 2)
_ArrayDisplay($aOL_Item) ; This code works before but today it was having issues and error under outlookex.au3

Global $aOL_Item = _OL_ItemFind($oOutlook, "RonaldJayson_paggao@comcast.com\Inbox\BP_automation", $olMail, "[UnRead]=True", "", "", "EntryID,Subject", "", 2)
_ArrayDisplay($aOL_Item) ; this code works but i need to use the above code that should display or get this properties "EntryID,body,receivedtime,senderemailaddress"

 

error.PNG

Link to comment
Share on other sites

IIRC this is caused by some type of mails in your inbox (read receipts etc.) which do not provide the full set of properties you request. To solve the problem you can

  1. reduce the number of properties to be returned, or
  2. call _OL_ErrorNotify(4) before calling _OL_ItemFind and then reset it by calling _OL_ErrorNotify(0). The disadvantage is that ALL error messages/@error settings get ignored.

I suggest to use the first solution by just returning EntryID. Then call _OL_ItemGet for each returned mail and retrieve the additional properties for the items you are interested in.

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,

 

Thank you for your response and solution for this issue. You are correct, a certain mail makes the issue with it's security settings. 

I will try to check how to use _OL_itemGet(). If you can give some example it would be great. :)

 

Thank you.

Link to comment
Share on other sites

The following code snippet searches for all unread mails in the inbox and displays the subject for the first unread mail:

#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)
_OL_ErrorNotify(2)
$aFolder = _OL_FolderAccess($oOutlook, "", $olFolderInbox)

Global $aResult = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "[Unread]=True", "", "", "EntryID")
If @error Then
    MsgBox(16, "OutlookEX UDF", "Error:  @error = " & @error & ", @extended = " & @extended)
Else
    Global $oItem = _OL_ItemGet($oOutlook, $aResult[1][0], Default, -1)
    MsgBox(0, "Test", "Subject of the first unread mail: " & @CRLF & $oItem.Subject)
EndIf
_OL_Close($oOutlook)

 

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

Glad you Like the OutlookEX 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

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