water Posted August 13, 2019 Author Posted August 13, 2019 Strange Now we have reached the end of my wisdom. Don't know what the next step should be. 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
Skysnake Posted August 14, 2019 Posted August 14, 2019 Master, your wisdom has not yet come to an end. There is simply more to learn. My understanding is limited. From what I understand one must Explicitly state the encoding text/plain multipart/alternative etc Repeat for each section My understanding of the code is also limited. Sequentially, WHEN must these calls be made? Perhaps our method is wrong? Create object MIME Add body MIME Add Attachment MIME etc? How? Skysnake Why is the snake in the sky?
water Posted August 15, 2019 Author Posted August 15, 2019 My understanding is even more limited I haven't done more than to write a function which tells Outlook to create a mail (either text or html). I have no knowledge about how the internals (Mime etc.) work. Everything I know I got from Google Playing with the internals would (at least) need: A clearly defined goal. Means: An example that defines how the result should look like (html text, attachments ...). So there is something to play with and that tells when the goal has been reached. A clearly defined environment where the mail as defined in #1 should be correctly displayed (Outlook, Google mail, Thunderbird ...) 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
seadoggie01 Posted August 29, 2019 Posted August 29, 2019 (edited) Am I doing something wrong? I'm trying to save an email item to the desktop using this code... which works only if I remove the _OL_ItemSave flag ... (32) ; 'Get Outlook' Local $oOL = _OL_Open() ; 'Get Sent items Folder' Local $folderProperties = _OL_FolderAccess($oOL, Default, $olFolderSentMail) If ErrMsg(@error, "_OL_FolderAccess -- " & @extended) Then Exit Debug("Folder Path: " & $folderProperties[5]) ; 'Find items with 'MY SUBJECT' as subject and get their EntryIDs' Local $entryIds = _OL_ItemFind($oOL, $folderProperties[1], $olMail, "", "Subject", "MY SUBJECT", "EntryID") If ErrMsg(@error, "OL Item Find: " & @extended) Then Exit If UBound($entryIds) > 1 Then ; 'Save the mail item as a message and (return the full path of the item ==> 32)' Debug(_OL_ItemSave($oOL, $entryIds[1][0], $folderProperties[3], @DesktopDir & "\", $olMSG, 32)) ErrMsg(@error, "OL Item Save: " & @extended) Else Debug("Not an array. Failed.") EndIf Edit: It doesn't save the item if I remove the flag, sorry Edited August 29, 2019 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
water Posted August 29, 2019 Author Posted August 29, 2019 Got it Flag 32 just tells to return the full path. But none of the flags that tells the function what to do is set. So it should be at least 33: 1 (save the item) + 32 (Return the full path) seadoggie01 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
seadoggie01 Posted August 29, 2019 Posted August 29, 2019 Oh. Wow. 😳 Thank you! 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
water Posted August 29, 2019 Author Posted August 29, 2019 Will add a comment to the UDF 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
seadoggie01 Posted September 23, 2019 Posted September 23, 2019 (edited) Any particular reason the OLDefaultFolders Enum isn't complete? I was trying to find the default public folder 😐 Edit: Oh... exchange account only, I see Edited September 23, 2019 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
water Posted September 23, 2019 Author Posted September 23, 2019 The UDF mainly holds the enumerations needed in one of the UDFs functions. Another reason for incompleteness is the age of the UDF. It has been started in early 2011. Maybe the constants need a brush up 🤔 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
Simpel Posted September 28, 2019 Posted September 28, 2019 Hi, I have this easy code that is returning an error: #include <OutlookEX.au3> Local $oOL = _OL_Open() If @error Then ConsoleWrite("! Error _OL_Open: " & @error & " " & @extended & @CRLF) Local $sTo = "outlooktest@maildrop.cc" Local $sSubject = "TEST" Local $sBody = "TEST" _OL_Wrapper_SendMail($oOL, $sTo, "", "", $sSubject, $sBody) If @error Then ConsoleWrite("! Error SendMail : " & @error & " " & @extended & @CRLF) Else ConsoleWrite("Success" & @CRLF) EndIf These error messages return: Quote >Running:(3.3.14.2):I:\AutoIt3\autoit3_x64.exe Address: outlooktest@maildrop.cc ! Error Recipients.Add: 1 0 ! Error SendMail : 4300 1 I added two ConsoleWrite() at Func _OL_ItemRecipientAdd() so error messages are hopefully more informative. Without both added ConsoleWrite() it only returns the last message. I'm running WIN10 1809 (Build 17763.678). The code is creating a draft with subject and body but not with a recipient. Some ideas what else to test? Simpel SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
Simpel Posted September 28, 2019 Posted September 28, 2019 COM error handling returns this: AA_Outlook-Test.au3 (3438) : ==> Global COM error handler - COM Error intercepted ! err.number is: 0x80004004 err.windescription: Vorgang abgebrochen err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 3438 err.retcode is: 0x00000000 Scriptline 3438 in OutlookEX.au3: $oTempRecipient = $vItem.Recipients.Add($aRecipientsOut[$iIndex]) SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
Simpel Posted September 28, 2019 Posted September 28, 2019 (edited) Well seemed to be that outlook and outlook365 isn't the same. And I use outlook 365. This @water replied: https://www.autoitscript.com/forum/topic/195766-_ol_wrapper_sendmail-error-1003-on-windows-10-1803/?do=findComment&comment=1403748 Funny it worked on another pc at some point some days ago. But I can't remember what I did that time. So I take a look at the post mentioned above. Simpel Edited September 28, 2019 by Simpel 365 instead 360 SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
Simpel Posted September 28, 2019 Posted September 28, 2019 After reading a lot I'm more confused. I have Outlook Desktop-App Version 16.0.11328.20392. Not sure what exactly it is. Is it Outlook 2016 included in O365? Simpel SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
seadoggie01 Posted September 28, 2019 Posted September 28, 2019 I would bet it is. Follow the shortcut for outlook, it'll take you to a file called Outlook16.exe I think. (Or mine at work did, where we also have Office 365). 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
Simpel Posted September 28, 2019 Posted September 28, 2019 The folder is called Office16. The executable itself is called OUTLOOK.EXE. So acting with COM object should be possible. SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
Simpel Posted September 29, 2019 Posted September 29, 2019 Maybe I found the reason for that behavior. I found some policies set at work. HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Outlook\Security adminsecuritymode=3 ; Use the security policy from the GPO settings PromptOOMCustomAction=0 PromptOOMSend=0 PromptOOMAddressBookAccess=0 PromptOOMAddressInformationAccess=0 PromptOOMSaveAs=0 PromptOOMFormulaAccess=0 0: Automatically deny, 1: Prompt user, 2: Automatically approve $oItem.HTMLBody $oItem.Recipients.Add("outlooktest@maildrop.cc") $oItem.Recipients.Resolve $oItem.Send All four lines above receive the COM error message "operation aborted". So I guess it is due to the policies. Could that be right? Which of the policies should be set to 2 to get the following work? #AutoIt3Wrapper_UseX64=n #include <OutlookEX.au3> _OL_ErrorNotify(1) Local $oOL = _OL_Open() Local $iFormat = $olFormatHTML Local $sEmpfaenger = "outlooktest@maildrop.cc" Local $sBetreff = "Subject" Local $sSignature = _OL_MailSignatureRead($oOL, $iFormat) Local $sMailText = "Body" & @CRLF & @CRLF & $sSignature Local $sAnhang = @ScriptFullPath _OL_Wrapper_SendMail($oOL, $sEmpfaenger, "", "", $sBetreff, $sMailText, $sAnhang, $iFormat) Func _OL_MailSignatureRead($oOutlook, $iFormat = 1) Local $oItem = $oOutlook.CreateItem(0) $oItem.BodyFormat = $iFormat $oItem.GetInspector Local $sBody Switch $iFormat Case 2 $sBody = $oItem.HTMLBody Case 3 $sBody = $oItem.RTFBody Case Else $sBody = $oItem.Body EndSwitch If @error then Return SetError(@error, @extended, "") If $iFormat = 3 Then $sBody = BinaryToString($sBody, $SB_ANSI) Return $sBody EndFunc I'm not in the position to test it by myself. So maybe someone can test it, so that I know what to recommend our IT. Simpel SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
water Posted September 29, 2019 Author Posted September 29, 2019 Ask them why they set all actions to deny. Is this for a reason or did they just copy a policy? 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
Gianni Posted October 30, 2019 Posted October 30, 2019 Hi all Is there a list of allowed "properties" for the seventh parameter of the _OL_ItemFind() function? (the $sReturnProperties parameter) I had success with: "EntryID, Subject, Body, ReceivedTime" but I'm not finding the right field name to get also the "From" field (who sends this eMail?) Thanks Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Nine Posted October 30, 2019 Posted October 30, 2019 (edited) @Chimp maybe https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem.actions ? all the properties are listed under it... Edited October 30, 2019 by Nine Gianni 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Gianni Posted October 30, 2019 Posted October 30, 2019 Thanks @Nine, I found what I was looking for at that link you posted. The "SenderName" property cheers Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
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