OutlookEX UDF - Help & Support (IV)
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By Cyborg5000
Can some one please point me why i keep getting the error while the script is in loop:-
"C:\Program Files (x86)\AutoIt3\Include\OutlookEX.au3" (2443) : ==> Subscript used on non-accessible variable.:
If Not (IsNumber($iAttachment)) Or $iAttachment < 1 Or $iAttachment > $aAttachments[0][0] Then Return SetError(8, $aAttachments[0][0], 0)
If Not (IsNumber($iAttachment)) Or $iAttachment < 1 Or $iAttachment > $aAttachments^ ERROR
My code as below though copied and modified as per need, to get attachments, and other details.
#include <StaticConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StringConstants.au3> #include <FileConstants.au3> #include <Array.au3> #include <String.au3> #include <UIAWrappers.au3> #include <GuiEdit.au3> #include <Clipboard.au3> #include <WinAPI.au3> #include <ColorConstants.au3> #include <FontConstants.au3> #include <ProgressConstants.au3> #include <Restart.au3> #include <_IEquerySelectorAll.au3> #include <GuiRichEdit.au3> #include <hiddenDesktopInteract.au3> #include <Date.au3> #include <CUIAutomation2.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <OutlookEX.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> ;Global $oErrorHandler = ObjEvent("Autoit.Error", "ComErrorHandler") FileDelete("D:\attachment\*.*") FileDelete("D:\Email-Details\*.*") FileDelete("D:\Script-temp\*.*") FileDelete("D:\Downloaded-Cert\*.*") FileDelete("D:\LOG\*.*") RunWait("taskkill /F /IM iexplore.exe /T", "", @SW_HIDE) ;Global $Errorcomments ;If Not IsDeclared($Errorcomments) Then Global $Errorcomments ; ***************************************************************************** ; Example Script ; Handle Outlook NewmailEX event when a new mail arrives. ; This script loops until Shift-Alt-E is pressed to exit. ; ***************************************************************************** HotKeySet("+!e", "_Exit") ;Shift-Alt-E to Exit the script ;MsgBox(64, "OutlookEX UDF Example Script", "Hotkey to exit the script: 'Shift-Alt-E'!") Global $oOApp = ObjCreate("Outlook.Application") Global $test = ObjEvent($oOApp, "oOApp_") While 1    Sleep(400) WEnd FileDelete("D:\attachment\*.*") FileDelete("D:\Email-Details\*.*") FileDelete("D:\Script-temp\*.*") FileDelete("D:\Downloaded-Cert\*.*") FileDelete("D:\LOG\*.*") RunWait("taskkill /F /IM iexplore.exe /T", "", @SW_HIDE) ; Outlook 2007 - NewMailEx event - http://msdn.microsoft.com/en-us/library/bb147646%28v=office.12%29.aspx Func oOApp_NewMailEx($sOL_EntryId)    FileDelete("D:\attachment\*.*")    FileDelete("D:\Email-Details\*.*")    FileDelete("D:\Script-temp\*.*")    FileDelete("D:\Downloaded-Cert\*.*")    FileDelete("D:\LOG\*.*")    RunWait("taskkill /F /IM iexplore.exe /T", "", @SW_HIDE)    Sleep(1000)    Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default)    Sleep(1000)    _OL_ItemAttachmentSave($oOApp, $oOL_Item, Default, 1, "D:\attachment\")    Sleep(1000)    ;MsgBox(64, "OutlookEX UDF Example Script", "New mail has arrived!" & @CRLF & @CRLF & _    ;"From:   " & $oOL_Item.SenderName & @CRLF & _    ;"Subject: " & $oOL_Item.Subject)    Local $oOL_Item1 = $oOApp.Session.GetItemFromID($sOL_EntryId, Default)    Sleep(1000)    Local $oOL_Sender = $oOL_Item1.Sender    If $oOL_Sender.AddressEntryUserType = $olExchangeUserAddressEntry Or $oOL_Sender.AddressEntryUserType = $olExchangeRemoteUserAddressEntry Then       Local $oExchangeUser = $oOL_Sender.GetExchangeUser    Else       Sleep(2000)    EndIf    Sleep(1000)    Local $sendername = ("D:\Email-Details\sendername.txt")    Local $Subject = ("D:\Email-Details\subject.txt")    ;=================================Subjectfile file write ===========================================    Local $Subject1 = FileOpen($Subject, $FO_APPEND)    If $Subject1 = -1 Then       MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst writing the Subject file.")       Return False    EndIf    ; Write data to the file using the handle returned by FileOpen.    FileWrite($Subject1, $oOL_Item1.Subject)    ; Close the handle returned by FileOpen.    FileClose($Subject1)    Sleep(1000) ;=================================End sendername file write ===========================================    $Filerunpath = ("C:\Users\certauto\Desktop\Test.Exe")    Local $iPID = Run($Filerunpath)    ProcessWaitClose($iPID)    Sleep(1000)    _OL_ItemModify($oOApp, $oOL_Item, Default, "Unread=False")    ;$openemail = WinActivate ( "[CLASS:NetUIHWND; INSTANCE:1]", "" )    ;ControlClick($openemail, "", "NUIDialog")    ;$oOApp.Session.Logoff    Sleep(1000)    ;====================Mark email as read===========================================    ;_OL_ItemModify($oOL_Item,$oOApp.Session.GetItemFromID($sOL_EntryId, Default, "Unread=False")    Sleep(1000) EndFunc  ;==>oOApp_NewMailEx Func _Exit()    Exit EndFunc  ;==>_Exit -
By Skysnake
This assumes implementation of the OutlookEX UDF.
I have PSTs which are becoming unmanageableÂ
The idea is to make a simple GUI (Listview) which can combine non-Outlook data and include emails based on criteria. Manage them in the GUI (delete / reply etc) and update to Outlook.
So the issue would be to manage the items in the GUI while using the PST as a database.
Ideas on how to do this? What would the key be?
-
By Reizvoller
Howdy!
I've been reading through the OutLookEX documentation and examples for the past two days ( VERY well documented, very clear! )Â
https://www.autoitscript.com/wiki/OutlookEX_UDF_-_General
Â
But I've had trouble locating information on specifying what user to use. My outlook is linked to two email accounts and I can only manipulate the main account's stuff. A simple script I've been playing with is thisÂ
; Include Functions #include <OutlookEX.au3> ; Connect to Outlook Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Connect to Outlook", "Error connecting to Outlook. @error = " & @error & ", @extended = " & @extended) ;List the folders Global $aResult = _OL_FolderTree($oOutlook, "*") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing root folder. @error = " & @error) _ArrayDisplay($aResult, "OutlookEX UDF: _OL_FolderTree Example Script - All folders") It works like a charm but it only returns my main account's folders.Â
I really hope I didn't overlook a wiki page or help file...Â
Any assistance would be greatly appreciated!
-Reiz
-
By galan2015
Is there any solution on receiving e-mails? I would like to create a script so that I will not have to log in through the browser.
-
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now