rapt3r Posted June 13, 2017 Share Posted June 13, 2017 hi water, thank you for you efforts and the outlookex udf. i've insalled the outlookex udf and found the script _OL_ItemAttachmentGet. Unfortunately it seems like i dont really understand how the script works. I want to select a specific inbox first. This inbox includes several mails where excel files can be found as attachments. I want to open the attachments sequentialy one after another, mail after mail and copy the complete contents of the excel files. When a excel attachment opens and the contents are copied i want to paste them into another excel file sheet after sheet. Mybe you could help me to understand the code better. thank you Link to comment Share on other sites More sharing options...
water Posted June 13, 2017 Author Share Posted June 13, 2017 Posted a reply in your other thread. 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 More sharing options...
water Posted January 5, 2018 Author Share Posted January 5, 2018 Version 1.3.2.0 of the UDF has been released. Please test before using in production! For download please see my signature. 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 More sharing options...
water Posted January 19, 2018 Author Share Posted January 19, 2018 Version 1.3.3.0 of the UDF has been released. Please test before using in production! For download please see my signature. mLipok 1 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 More sharing options...
UEZ Posted January 19, 2018 Share Posted January 19, 2018 @water: the download file seems to be corrupt. Please update. Earthshine 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Earthshine Posted January 19, 2018 Share Posted January 19, 2018 i just downloaded it, says there is stuff past the payload.... My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
water Posted January 19, 2018 Author Share Posted January 19, 2018 Replaced th corrupted ZIP-file with a newly created one! Hope this fixes those Windows problems when creating a ZIP-file Skysnake 1 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 More sharing options...
Skysnake Posted January 22, 2018 Share Posted January 22, 2018 @water, a little advice please? What is the correct way for testing if the object.Outlook exists before trying to access it with AutoIt? ie Outlook not installed... Skysnake Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
water Posted January 22, 2018 Author Share Posted January 22, 2018 Try function If IsObj($oOutlook) Then ... 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 More sharing options...
Cotino Posted March 27, 2018 Share Posted March 27, 2018 Hi, I'm trying to make a custom mail notification. I found your UDF (which is awesome btw) and it works nicely, except for one thing.It doubles every CR LF Here's a simple working example : #include <OutlookEX\OutlookEX.au3> #include <String.au3> #include <Array.au3> HotKeySet("{END}", "_Exit") ;END to Exit the script MsgBox(64, "OutlookEX UDF Example Script", "Hotkey to exit the script: 'END'!") Global $oOApp = ObjCreate("Outlook.Application") Global $test = ObjEvent($oOApp, "oOApp_") While 1 Sleep(10) WEnd Func oOApp_NewMailEx($sOL_EntryId) Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) ConsoleWrite($oOL_Item.Body) Local $arr = _StringExplode($oOL_Item.Body, "") Local $arr2[3][UBound($arr)] For $i = 0 To UBound($arr)-1 $arr2[0][$i] = $arr[$i] $arr2[1][$i] = Asc($arr[$i]) $arr2[2][$i] = "0x" & Hex(Asc($arr[$i]), 2) Next _ArrayDisplay($arr2) EndFunc Func _Exit() Exit EndFunc Here the body of the mail i sent to myself : And here's the result : As you can see, the CR LF (0x0D/0x0A) appear twice, when they should only appear once. This is using Outlook 2016 on Windows 10 Pro x64. Link to comment Share on other sites More sharing options...
water Posted March 27, 2018 Author Share Posted March 27, 2018 What is the value of $oOL_Item.BodyFormat? 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 More sharing options...
Cotino Posted March 27, 2018 Share Posted March 27, 2018 "2", whatever that is. Link to comment Share on other sites More sharing options...
water Posted March 27, 2018 Author Share Posted March 27, 2018 2 stands for HTML format. I suggest to use StringReplace to replace two @CRLF with a single @CRLF. 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 More sharing options...
Cotino Posted March 27, 2018 Share Posted March 27, 2018 Good enough workaround. Does this always happen if you try to access .body on a HTML mail ? Link to comment Share on other sites More sharing options...
Cotino Posted March 28, 2018 Share Posted March 28, 2018 (edited) I've got another problem, although i suppose it's more of a Microsoft issue. .SenderEmailAddress doesn't return the email address, but instead this : /O=COMPANY NAME/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=8C32D83BCA9D43A18330B71CE2C585C4-BRUN .SenderEmailType returns "EX" and .Sender doesn't return anything. How can i get the sender's mail ? Alternatively, same problem for Cc. It returns the Cc's name instead of mail address. Edited March 28, 2018 by Cotino Link to comment Share on other sites More sharing options...
water Posted March 29, 2018 Author Share Posted March 29, 2018 On 27.3.2018 at 4:07 PM, Cotino said: Good enough workaround. Does this always happen if you try to access .body on a HTML mail ? To access an HTML body you usually use property HTMLBody. 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 More sharing options...
water Posted March 30, 2018 Author Share Posted March 30, 2018 On 28.3.2018 at 10:13 AM, Cotino said: How can i get the sender's mail ? Will check as soon as I return to my office. 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 More sharing options...
water Posted March 31, 2018 Author Share Posted March 31, 2018 This returns the senders primary SMTP mail address: #include <OutlookEX.au3> HotKeySet("{END}", "_Exit") ;Shift-Alt-E to Exit the script MsgBox(64, "OutlookEX UDF Example Script", "Hotkey to exit the script: 'End'!") Global $oOApp = _OL_Open() Global $test = ObjEvent($oOApp, "oOApp_") While 1 Sleep(10) WEnd _OL_Close($oOApp) ; Outlook 2007 - NewMailEx event - http://msdn.microsoft.com/en-us/library/bb147646%28v=office.12%29.aspx Func oOApp_NewMailEx($sOL_EntryId) Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) Local $oOL_Sender = $oOL_Item.Sender If $oOL_Sender.AddressEntryUserType = $olExchangeUserAddressEntry Or $oOL_Sender.AddressEntryUserType = $olExchangeRemoteUserAddressEntry Then Local $oExchangeUser = $oOL_Sender.GetExchangeUser MsgBox(0, "Mail", $oExchangeUser.PrimarySmtpAddress) EndIf EndFunc ;==>oOApp_NewMailEx Func _Exit() Exit EndFunc ;==>_Exit 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 More sharing options...
seadoggie01 Posted November 21, 2018 Share Posted November 21, 2018 (edited) I'm sorry if this has been posted previously, I looked though I'm logged in using my account (my.name@company.org) and trying to look at a shared Exchange account (company.dept@company.org). When I use: $objOutlook = _OL_Open() _OL_FolderAccess($objOutlook, "\\company.dept@company.org\Inbox\") it returns an error 3 with extended info of -2147352567. Recognizing this from VBA I looked at the source for _OL_FolderAccess and recreated it in VBA... Set myNamespace = Application.GetNamespace("MAPI") Set dummy = myNamespace.CreateRecipient("=company.dept@company.org") dummy.Resolve Debug.Print myNamespace.GetSharedDefaultFolder(dummy, olFolderInbox) This returns a 'Run-time error -2147221219' and suggests closing and restarting Outlook and possibly reinstalling. What I don't understand is that as soon as I took out the equals sign, it ran just fine and printed the Inbox folder. What is strict resolve and did I do something wrong here? Edit: This UDF is amazing though. Thank you soooooo much! Edited November 21, 2018 by seadoggie01 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
water Posted November 21, 2018 Author Share Posted November 21, 2018 Try: _OL_FolderAccess($objOutlook, "company.dept@company.org\Inbox\") 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 More sharing options...
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