Jump to content

Recommended Posts

Posted

When you run _Ol_Open on this machine do you get an error (@error <> 0)? Or do you still get the configuration screen?

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

 

Posted

Then there is at least the default profile - but not fully configured. 

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

 

Posted

So you could open Outlook, check for errors and close Outlook again. 

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

 

Posted

Yeah, if I can't avoid the crash with _OL_MailSignatureGet error handling in any way, it would have to use _OL_Open.
Problem with _OL_Open  is that if a user is starting up Outlook manually while _OL_Open is used, then Outlook closes again for that user.

I will try to see if I can fix the error handling of _OL_MailSignatureGet  somehow.

Thanks for your time water !

Posted (edited)

Okay with even more testing I found out that it's only the _OL_Close function that causes their manual start of Outlook to close :-)

I think that my speaking time on this thread is used up the next couple of days! Have a nice weekend :D

Edited by david1337
Posted

Hi!

I have allmost figured out how to copy messages from one folder to another. But what should i do if there are subfolders? Also please can you explane what does the [0][0] & [1][0] next to $aOL_Item means? Sorry if it is a dumb question, i am not a coder(((

Local $sFilePath = "C:\tmp\outlook.log"
Local $iFileExists = FileExists($sFilePath)
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
If $iFileExists Then
    MsgBox($MB_SYSTEMMODAL, "Error, outlook.log exists", "this operation shuold run once" )
 Else
   _FileCreate("c:\tmp\outlook.log")
   $aOL_Item = _OL_ItemFind($oOutlook, "*\\Входящие", $olMail, "", "", "", "EntryID")
    While  $aOL_Item[0][0] > 0
   $aOL_Item = _OL_ItemFind($oOutlook, "*\\Входящие", $olMail, "", "", "", "EntryID")
   _OL_ItemMove($oOutlook, $aOL_Item[1][0], Default, "*\\Inbox")
   If @error = 1 Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error)
   Wend
EndIf
_OL_Close($oOutlook)

 

Posted (edited)

You need to loop through the array like this:

Local $sFilePath = "C:\tmp\outlook.log"
Local $iFileExists = FileExists($sFilePath)
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
If $iFileExists Then
    MsgBox($MB_SYSTEMMODAL, "Error, outlook.log exists", "this operation should run once" )
Else
   _FileCreate("c:\tmp\outlook.log")
   $aOL_Item = _OL_ItemFind($oOutlook, "*\\Входящие", $olMail, "", "", "", "EntryID")
   For $i = 1 to $aOL_Item[0][0]
       _OL_ItemMove($oOutlook, $aOL_Item[$i][0], Default, "*\\Inbox")
       If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error)
   Next
EndIf
_OL_Close($oOutlook)

$aOL_Item[0][0] holds the number of data rows in the array, $aOL_Item[0][1] the number of columns.

Edited by water
Fixed typo

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

 

Posted

Glad you like my solution :)

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

 

Posted

btw, what should i do with the subfolders? is there a way to move like this : "\\inbox1\*" "\\inbox2\"  to move all the existing subfolders to inbox2 without moving the parent folder inbox1?

Posted

Use _OL_FolderTree to get a list of folders in "\\inbox1\*" and then loop through the returned array and use _OL_FolderMove for each entry.

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

 

Posted (edited)

What am i doing wrong?

$aFol = _OL_FolderTree($oOutlook, "*\\Входящие\")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing folder 'Outlook-UDF-Test'. @error = " & @error)
;_ArrayDisplay($aFol, "OutlookEX UDF: _OL_FolderTree Example Script - Tree starting with '*\Outlook-UDF-Test'")
For $i = 1 to $aFol[0][0]
       _OL_FolderMove($oOutlook, $aFol[$i][0], "*\\Inbox")
       If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error)
   Next

I get an error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.(((

 

Edited by bon3o
  • Developers
Posted (edited)
2 minutes ago, bon3o said:

Why do i get hidden post`s?

There is a check in our forums to avoid spam that does this. Not going to explain too much about it, but don't worry, we will approve them when one of us is around.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

_OL_FolderMove moves the folder and all subfolders. So you only need to list the first level of directories using _OL_FolderTree.

$aFol = _OL_FolderTree($oOutlook, "*\\Входящие\", 1)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing folder 'Outlook-UDF-Test'. @error = " & @error)
;_ArrayDisplay($aFol, "OutlookEX UDF: _OL_FolderTree Example Script - Tree starting with '*\Outlook-UDF-Test'")
For $i = 1 to $aFol[0][0]
    _OL_FolderMove($oOutlook, $aFol[$i][0], "*\\Inbox")
    If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error)
Next

 

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

 

Posted

Unfortunately i get the same error((

"D:\Desktop\FolderMove.au3" (14) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
For $i = 1 to $aFol[0][0]
For $i = 1 to ^ ERROR

Posted (edited)

_OL_FolderTree returns a 1D array. So the script should look like:

$aFol = _OL_FolderTree($oOutlook, "*\\Входящие\", 1)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing folder 'Outlook-UDF-Test'. @error = " & @error)
;_ArrayDisplay($aFol, "OutlookEX UDF: _OL_FolderTree Example Script - Tree starting with '*\Outlook-UDF-Test'")
For $i = 1 to $aFol[0]
    _OL_FolderMove($oOutlook, $aFol[$i], "*\\Inbox")
    If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error)
Next

 

Edited by water

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

 

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
  • Recently Browsing   0 members

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