horphi Posted August 1, 2015 Posted August 1, 2015 The SQL generator inside Outllook define the body as textdescription.("urn:schemas:httpmail:subject" LIKE '%ACS%' AND "urn:schemas:httpmail:textdescription" LIKE '%TEST%')
water Posted August 1, 2015 Author Posted August 1, 2015 Is the mail formatted as HTML or Rich Text? 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
horphi Posted August 1, 2015 Posted August 1, 2015 Is the mail formatted as HTML or Rich Text?It´s both...sometimes rich, sometimes html....
horphi Posted August 1, 2015 Posted August 1, 2015 Nevertheless, the Mails get found but without Body...:-(
water Posted August 1, 2015 Author Posted August 1, 2015 (edited) Ah, I remember.With DASL you can't retrieve the whole body. You only get the first 255 bytes of the body:#include <OutlookEX.au3> #include <Array.au3> Global $oOutlook = _OL_Open() $sTerm = "ACS" $sInbox = "*\Posteingang" $sSQL = "@SQL=urn:schemas:httpmail:subject ci_startswith " & "'" & $sTerm & "'" Global $aItems = _OL_ItemSearch($oOutlook, $sInbox, $sSQL, "EntryId,Subject,urn:schemas:httpmail:textdescription") ConsoleWrite(@error & @CRLF) _ArrayDisplay($aItems) _OL_Close($oOutlook)So if you need the full body you would need to call _OL_ItemGet for each found mail item. Edited August 1, 2015 by water horphi 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
horphi Posted August 1, 2015 Posted August 1, 2015 Hello Water,thx for reply thats also possible. :-)One further question: if i choose the property inside the Function _OL_ItemGet(), it returns error.But if i let the Property emtpy, it returns the complete E-Mail with all prpoerties inside the array...Do you know why?Global $aItems = _OL_ItemGet($oOutlook, 'EF0000009B491F81D6791A47AA9A1EC0758DAA05245A2A00',"Body") BRhorphi
water Posted August 1, 2015 Author Posted August 1, 2015 If you do not specify any properties to return then all properties will be returned (default). So WAD.You missed to specify the StoreID. Try:Global $aItems = _OL_ItemGet($oOutlook, 'EF0000009B491F81D6791A47AA9A1EC0758DAA05245A2A00', Default, "Body") horphi 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
horphi Posted August 1, 2015 Posted August 1, 2015 Damned you are right....I forgot to set the $sStoreID on default.....sry for that stupid question....:-(Thanks anyway...:-)
water Posted August 1, 2015 Author Posted August 1, 2015 horphi 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
VishnuNair Posted August 24, 2015 Posted August 24, 2015 Hello,I am using Outlook 2013. Will this UDF work? I just want to check the calender for a specific time slot and return a value if it is free or not. Is this possible?Please let me know.Thanks,
horphi Posted August 24, 2015 Posted August 24, 2015 (edited) Hello,I am using Outlook 2013. Will this UDF work? I just want to check the calender for a specific time slot and return a value if it is free or not. Is this possible?Please let me know.Thanks, Hi VishnuNair,yes i´m working also with MS Outl 2013. I works fine.BRHorphi Edited August 25, 2015 by horphi
water Posted August 24, 2015 Author Posted August 24, 2015 I only have Office 2010 available and so would like to hear of any problems you notice with Office 2013. 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
david1337 Posted October 6, 2015 Posted October 6, 2015 Is it possible with this UDF to determine what the name of the default Outlook profile is, for the current user?
water Posted October 7, 2015 Author Posted October 7, 2015 I am on a business trip right now. Will reply 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
water Posted October 8, 2015 Author Posted October 8, 2015 Function _OL_ApplicationGet returns an array filled with information about Outlook. Element 1 is the name of the default profile. 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
david1337 Posted October 9, 2015 Posted October 9, 2015 Hi waterThanks for your reply, that worked perfectly. Very powerful tool!Is there also a way to find the account name of the default account?
water Posted October 9, 2015 Author Posted October 9, 2015 (edited) Can't test at the moment but I think it is$oNameSpace = $oOutlook.GetNameSpace("MAPI") MsgBox(0, "", $oNameSpace.CurrentUser.Name) Edited October 9, 2015 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
water Posted October 9, 2015 Author Posted October 9, 2015 I see. But this works - at least as you are logged on as the default account.#include <OutlookEX.au3> $oOL = _OL_Open() $oNameSpace = $oOL.GetNameSpace("MAPI") MsgBox(0, "", $oNameSpace.CurrentUser.AddressEntry.GetExchangeUser.PrimarySmtpAddress) _OL_Close($oOL) 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
david1337 Posted October 9, 2015 Posted October 9, 2015 (edited) That is close to what I wanted. But this gives me the name of my email address. The actual account name can differ from that, if the user has renamed the account.What I'm trying to achieve with this:I wanna find out which registry folder (0000000X) is connected with the default Email account.HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\" & $DefaultOutlookProfile & "\9375CFF0413111d3B88A00104B2A6676\00000001 <---000000010000000200000003etc.In my case I know that 00000003 is the folder containing settings for my main Email account. This I know because the REG_BINARY value named Account Name inside the 00000003 folder, contains the name of my default account, which in this case is "NameOfMyAccount"So if I could get the name of the default account I could:"If $StringAccountName = $DefaultAccount Then....." I hope that I make myself clear. Maybe you have another suggestion to how I could achieve this?Thanks!David Edited October 9, 2015 by david1337
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