Hi Water,
I have been trying to get the create pst function to work but are stuck with an OL-Open @error= 5 and @extended=0 which i can not get resolved. I am running on a Win 7 x64 machine with Office 2010 x32 installed on it.
#include <OutlookEX.au3>
#include <Array.au3>
#include <File.au3>
_OL_Open()
SplashTextOn("Please wait", "Mailbox sync in progress." & @CRLF & @CRLF & "If a window asking for your ID and password pops-up," & @CRLF & "please enter them and click on OK." & @CRLF & @CRLF & "Once you entered your ID and password or if they were not asked," & @CRLF & "please do not use your computer while this window is showing." & @CRLF & @CRLF & "Sync time is approximatively around 1 min.", 600, 215, -1, -1, 18)
$outlook = _OL_Open(True)
If @error Then Exit MsgBox(0, "Error", "_OL_Open: @error = " & @error & ", @extended = " & @extended)
$pst = _OL_PSTCreate($outlook, @UserProfileDir & "C:\outlook\exchangebackup.pst", "Exchange backup")
If @error Then Exit MsgBox(0, "Error", "_OL_PSTCreate: @error = " & @error & ", @extended = " & @extended)
SplashTextOn("Please wait", "Mailbox backup in progress." & @CRLF & @CRLF & "If a window asking for your ID and password pops-up," & @CRLF & "please enter them and click on OK." & @CRLF & @CRLF & "Once you entered your ID and password or if they were not asked," & @CRLF & "please do not use your computer while this window is showing." & @CRLF & @CRLF & "Backup time depends on how large your mailbox is.", 600, 215, -1, -1, 18)
$folders = _OL_FolderTree($outlook, "*")
If @error Then Exit MsgBox(0, "Error", "_OL_FolderTree: @error = " & @error & ", @extended = " & @extended)
For $i = 2 To UBound($folders) - 1 Step 1
If StringInStr(StringMid($folders[$i], 3), StringMid($folders[0], 3)) <> 0 Then
$current_folder = _OL_FolderAccess($outlook, StringMid($folders[$i], 3))
If @error Then Exit MsgBox(0, "Error", "_OL_FolderAccess for folder: " & $folders[$i] & ". @error = " & @error & ", @extended = " & @extended)
_OL_FolderCopy($outlook, $current_folder[1], $pst)
If @error Then Exit MsgBox(0, "Error", "_OL_FolderCopy for folder: " & $folders[$i] & ". @error = " & @error & ", @extended = " & @extended)
EndIf
Next
_OL_Close($outlook)
SplashOff()
I am fairly new in scripting but would appreciate your help.
Thanks
Patrick