Jump to content

Outlook automation in a Shared mailbox - (Moved)


Recommended Posts

Dear members of the forum,

I'm working on a project where incoming emails are to be analyzed based on the subject line and moved to various folders in a shared mailbox.

I'm using "OutlookEx.au3" of @water. The macro can can move emails  to any folder that I newly create. But the macro couldn't move emails to specific folders that are already existing.

I checked the permission levels of those folders and found that nothing is wrong with that. The function I use is _OL_ItemMove.

Please guide me how to proceed further. Thanks in advance.

-Gowrisankar.

 

Link to comment
Share on other sites

The value of @error and @extended after _OL_ItemMove should shed some light onto the subject.

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

@error 4 stands for: Specified folder could not be found.

Can you please post the _OL_ItemMove statement you run?

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

16 minutes ago, water said:

@error 4 stands for: Specified folder could not be found.

Can you please post the _OL_ItemMove statement you run?

_OL_ItemMove($oOutlook, $sEntryId1, Default, $sDestinationFolder)

(Example : $sDestinationFolder = "abc.xyz@abc.com\Inbox\Central")

The folder is present in mailbox and I've even checked the spellings, extra punctuation, spaces etc., and everything is correct. 

Edited by Gowrisankar
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 or AutoIt Technical Discussion forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Can you please test to access the Folder using _OL_FolderAccess?
@error and @extended will then give better error Information.

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

On 11/22/2018 at 5:06 PM, water said:

Can you please test to access the Folder using _OL_FolderAccess?
@error and @extended will then give better error Information.

@water, I tried _OL_FolderAccess and got the following. @error = 4 ; @extended = 3

As in the example, "abc.xyz@abc.com\Inbox\Central" the @extended denotes that error is in accessing the folder "Central".

Edited by Gowrisankar
Link to comment
Share on other sites

Can you please post the full line where you call _OL_FolderAccess (means: Do you set parameters $iFolderType or $iItemType?).

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

3 minutes ago, water said:

Can you please post the full line where you call _OL_FolderAccess (means: Do you set parameters $iFolderType or $iItemType?).

@water, I dont' call _OL_FolderAccess.

I use item move statement as below.

_OL_ItemMove($oOutlook, $sEntryId1, Default, $sDestinationFolder)

I presume _OL_FolderAccess is called from _OL_ItemMove.

Link to comment
Share on other sites

This is the code I use for Folder access... please ignore the previous response. I mistook it.

Global $aFolder = _OL_FolderAccess($oOutlook, "abc.xyz@abc.com\Inbox\Central")

Global $aFolderDisplay[6][2] = [[$aFolder[0]],["","Folder object"],["","Default item type for the folder"],["", "StoreID where the folder resides"],["", "EntryID of the folder"],["", "Folder path"]]

$aFolderDisplay[1][0] = $aFolder[1]

$aFolderDisplay[2][0] = $aFolder[2]

$aFolderDisplay[3][0] = $aFolder[3]

$aFolderDisplay[4][0] = $aFolder[4]

$aFolderDisplay[5][0] = $aFolder[5]

_ArrayDisplay($aFolderDisplay, "Folder successfully accessed.")

Edited by Gowrisankar
Link to comment
Share on other sites

OK, let's strip it down as far as possible:

Global $aFolder = _OL_FolderAccess($oOutlook, "abc.xyz@abc.com\Inbox")
ConsoleWrite("Inbox: @error = " & @error & ", @extended = " & @extended & @CRLF)
Global $aFolder = _OL_FolderAccess($oOutlook, "abc.xyz@abc.com\Inbox\Central")
ConsoleWrite("Inbox\Central: @error = " & @error & ", @extended = " & @extended & @CRLF)

Please post the output of the SciTE console pane.

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

21 minutes ago, water said:

OK, let's strip it down as far as possible:

Global $aFolder = _OL_FolderAccess($oOutlook, "abc.xyz@abc.com\Inbox")
ConsoleWrite("Inbox: @error = " & @error & ", @extended = " & @extended & @CRLF)
Global $aFolder = _OL_FolderAccess($oOutlook, "abc.xyz@abc.com\Inbox\Central")
ConsoleWrite("Inbox\Central: @error = " & @error & ", @extended = " & @extended & @CRLF)

Please post the output of the SciTE console pane.

I'll get back to you after 3-4 hours @water. Thanks for your support.

Link to comment
Share on other sites

Do you run your script or mine?
My script does not show a "pop up".

If you run my script then the message you posted tells us that accessing the Inbox does not work. Because when there is a problem with "Central" the message would tell "Inbox\Central" not just "Inbox".

Please run my 4-line-script and post the exact output (all lines) you get from SciTE.

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

@water, the problem is within a client machine and they don't have AutoIt installed. So I shared 2 exe files one for "Inbox" and one for "Inbox\Central" with array display for positive results and message box with @error and @extended for negative results.

That is how I got the result as @error = 4, @extended = 3

Link to comment
Share on other sites

Does the client machine have a different language setup?
I have a german setup and hence my directory structure would be named "abc.xyz@abc.com\Posteingang\Central"

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

Can you try to access the Inbox\Central folder on your machine?
If it works we know it is related to a single/few computers. If it doesn't work at all we know it is a global problem.

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

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