de82 Posted May 24, 2017 Share Posted May 24, 2017 Fixed It All I had to do was read the supplied documentation and use the function _OL_ItemRecipientGet and it works nicely. So going forwards I need to get the MessageClass property for each MSG file being processed. If the class is IPM_Note then use the _OL_ItemGet function to retrieve the recipient list. If the class is a meeting then use the _OL_ItemRecipientGet function instead. As I said I have over 4.8 Million emails spanning 12 years to process so it will certainly give your code a good test run. Link to comment Share on other sites More sharing options...
water Posted May 24, 2017 Author Share Posted May 24, 2017 Glad your problem could be solved de82 1 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
HighlanderSword Posted June 16, 2017 Share Posted June 16, 2017 (edited) Hello Water, Can you provide a location where a list of all of the return Property Names can be found for Ol_Item_Find, I have several that I need to return but am having no luck finding a list of all of the available ones for email and contacts. One Such example would be for a Mail item, the Folder that the item is stored in Outlook Please let me know. Thanks Paul Edited June 16, 2017 by HighlanderSword Link to comment Share on other sites More sharing options...
water Posted June 16, 2017 Author Share Posted June 16, 2017 There different properties for different items. Example: Outlook 2010, MailItem: https://msdn.microsoft.com/en-us/library/ff870913(v=office.14).aspx Outlook 2010 Object Model Reference: https://msdn.microsoft.com/en-us/library/ff870566.aspx My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
HighlanderSword Posted June 17, 2017 Share Posted June 17, 2017 OK, unless I'm missing it I do not see an property for the Folder the Mail item is stored in. Any ideas ? Link to comment Share on other sites More sharing options...
HighlanderSword Posted June 17, 2017 Share Posted June 17, 2017 Ok, I've found where the folder location is stored its in Parent.FolderPath for each item, When I pass Parent.FolderPath to the ol_Item_Find it does not work Help ! Link to comment Share on other sites More sharing options...
water Posted June 17, 2017 Author Share Posted June 17, 2017 How do you pass Parent.Folderpath to _OL_ItemFind? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
HighlanderSword Posted June 17, 2017 Share Posted June 17, 2017 (edited) local $aResult = _ol_itemfind($oOutlook, $folder, $olmail, $strsearchsql, "", "", "Subject,SenderName,UnRead,SenderEmailAddress,Parent.FolderPath", "", 1) And I get @error 1005 When I remove Parent.FolderPath it works with no issues Edited June 17, 2017 by HighlanderSword Link to comment Share on other sites More sharing options...
water Posted June 17, 2017 Author Share Posted June 17, 2017 (edited) The function doesn't work this way. It checks the properties to be returned and sets @error to 100x when a property is unknown. You can only retrieve Parent and then retrieve Parent.FolderPath in a second step. Edited June 17, 2017 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
TOTOTO Posted July 13, 2017 Share Posted July 13, 2017 On 13/05/2017 at 8:28 PM, water said: You could add some additional error checking (plus I added a save statement): $oItem = _OL_ItemCreate($oOutlook, $olMailItem) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating item. @error = " & @error & ", @extended = " & @extended) $oItem.BodyFormat = $olFormatHTML If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error modifying item. @error = " & @error & ", @extended = " & @extended) $oItem.Save() ; Added because the item has been modified. $sOrigBody = $oItem.HTMLBody If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error saving the body to a variable. @error = " & @error & ", @extended = " & @extended) Sorry for the late reply, the error comes to the last step of saving body: Error saving the body to a variable. @error = -2147467260, @extended = 0 Googled the error -2147467260, looks like it's related to access permission. I'm in the local administrators group, not sure what kind of permission is required here... Link to comment Share on other sites More sharing options...
water Posted July 13, 2017 Author Share Posted July 13, 2017 This error code stands for: "Exception from HRESULT: 0x80004004 (E_ABORT)". Unfortunately Google Returns a lot of explanations for this code Can you please add this line after _OL_Open so we get more detailed error Information? _OL_ErrorNotify(2) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Automator_83 Posted August 8, 2017 Share Posted August 8, 2017 Hello all, This seems to be an interesting UDF overall. Can someone point me on how to 'CREATE an outlook profile' through this UDF. I was trying to search for '_OL_CreateProfile' - but couldn't really get anything closer. Any help would be greatly appreciated.. Thanks Link to comment Share on other sites More sharing options...
water Posted August 8, 2017 Author Share Posted August 8, 2017 (edited) Welcome to AutoIt and the forum! Unfortunately you can't create profiles with this UDF - that's an Outlook limitation. But you can create a text file and start Outlook with command line switch "/importprf prffilename" to create the profile for you. How to to create a PRF file can be found here (and many other places): https://technet.microsoft.com/en-us/library/cc179062(v=office.14).aspx Edited August 8, 2017 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Raffav Posted August 15, 2017 Share Posted August 15, 2017 On 07/12/2016 at 3:18 PM, Raffav said: Some progress, but new error error 501 / extended 400 PS: iam using multiple imap accounts @water Good day I need one more help from you i qouted one of our talk so you can remembering the case, i was getting some problems with the udf and after some debug you find the fix, now I am getting the same error error 501 / extended 400 on a different pc, I run the step to get some Com debug and one messanger is different i will post it a soon I get to my pc, i even copy the same version outlookEx/constants from working pc. No success. Link to comment Share on other sites More sharing options...
water Posted August 15, 2017 Author Share Posted August 15, 2017 error 501 is set by function _OL_TestEnvironmentCreate. extended 400 is returned by _OL_ItemRecipientAdd and stands for: Recipient name could not be resolved. What is the value of $sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Raffav Posted August 15, 2017 Share Posted August 15, 2017 5 minutes ago, water said: error 501 is set by function _OL_TestEnvironmentCreate. extended 400 is returned by _OL_ItemRecipientAdd and stands for: Recipient name could not be resolved. What is the value of $sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name @water yes, you have made some change, to remember go to my quote and read from there. just a min I will post your request Link to comment Share on other sites More sharing options...
Raffav Posted August 15, 2017 Share Posted August 15, 2017 @water And about your command I get my name Raffaello Vaselli Link to comment Share on other sites More sharing options...
Stormgrade Posted August 18, 2017 Share Posted August 18, 2017 Hello, Can I use this UDF to read my inbox mail from an Exchange server without Microsoft Outlook ? Link to comment Share on other sites More sharing options...
water Posted August 18, 2017 Author Share Posted August 18, 2017 Short answer: No. You need to check which protocols are supported by Exchange (Pop3, IMap) and then check the UDF section in the wiki for an UDF that fits your needs. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Raffav Posted August 18, 2017 Share Posted August 18, 2017 On 09/12/2016 at 11:23 AM, water said: I needed to change two things: The item needs to be saved before we can access certain properties We need to modify other words in the mail template #include <OutlookEX.au3> Global $oItem Global $oOutlook = _OL_Open() Global $Result = _OL_TestEnvironmentCreate($oOutlook) $oItem = _OL_ItemCreate($oOutlook, $olMailItem, "*\Outlook-UDF-Test\TargetFolder\Mail", @ScriptDir & "\_OL_ItemCreate.oft") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = " & @error & ", @extended = " & @extended) $oItem.Save() ; Retrieve the current mail body (HTML) $sHTML = $oItem.HTMLBody ; Modify place holders $sHTML = StringReplace($sHTML, "Example mail", "Exemplo de correio") $sHTML = StringReplace($sHTML, "template", "modelo") ; Rewrite the mail body $oItem.HTMLBody = $sHTML ; Display the changed item $oItem.Display @water The 1 problem i figure out i need to create a contact with my name is a way to bypass this? 2 problem now, the HTML is not being edited on my work pc it works , but my both home pc dont. on home pc i am not getting the outlook security alert to permit or deny the access, any suggestion ? Link to comment Share on other sites More sharing options...
Recommended Posts