Mape Posted August 3, 2021 Share Posted August 3, 2021 Hello, For some reason the OutlookEX -integration stopped sending emails. I had it running for months without any problems, so something must have changed in Outlook, I quess. Symptoms are as follows: -when trying to send an email using " _OL_Wrapper_SendMail($oOL, $distrib, "", "", $header,$body,$emailfile, $olFormatHTML) " @error remains not set. The mail is how ever not sent and after a while it appears in the Drafts -folder of Outlook (with content and recipient information) -When trying to use: Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Outlook-UDF-Test\TargetFolder\Mail", "", _ "Subject=TestMail", "BodyFormat=" & $olFormatHTML, "HTMLBody=Bodytext in <b>bold</b>.", "To=xx@xxx.xx") _OL_ItemSend($oOL, $oItem) it sets the @extended to -2147352567 and fails. The wrapper version has worked before, doesn't work anymore when tested with two different computers and I am using my own email account for the purpose, no change in there either. Any idea where the problem might be? Link to comment Share on other sites More sharing options...
water Posted August 3, 2021 Share Posted August 3, 2021 -2147352567 (decimal) is 0x80020009 (hex) and stands for a "General error". Could you please insert "_OL_ErrorNotify(2)" before _OL_ItemCreate so we get more detailed error information? 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...
Mape Posted August 3, 2021 Author Share Posted August 3, 2021 Ok, here is the output of that. Seems that for some reason OL object is lost...? Link to comment Share on other sites More sharing options...
Solution water Posted August 3, 2021 Solution Share Posted August 3, 2021 Please have a look at the Wiki. Maybe the auto-shutdown feature of Outlook causes the problem. Quote Outlook (starting with Outlook 2007 SP2) shuts itself down if there is no open window (which is always true when Outlook was not running when _OL_Open is being called) and there is no open reference to an Outlook item (mail, appointment ...). This is described in the following MSDN article: "Application Shutdown Changes in Outlook 2007 SP2" So a bug in the UDF or your code can cause Outlook to shut down prematurely. 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...
Mape Posted August 4, 2021 Author Share Posted August 4, 2021 Thankyou water for this! I thought that having Outlook Window visible in screen would be enough and a proof of it running. When I added Winactivate("Inbox") before intiating Outlook Object it started to work! Skysnake 1 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