Queener Posted April 7, 2014 Share Posted April 7, 2014 (edited) 4xxx means: Error adding adding recipients (to, cc and bcc). The code you posted in #73 is the code that throws the error? yes. What I don't get is; it works fine on win 8. Just not 7. Another thing is; win 8 is 64bit os while win 7 is 32bit. It still should affect, I believe. Edited April 7, 2014 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
water Posted April 7, 2014 Author Share Posted April 7, 2014 Is Office 32 bit on both machines? Do you compile the AutoIt script for 64 or 32 bit? 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...
Queener Posted April 8, 2014 Share Posted April 8, 2014 on the 32 machine, I use the script to compile as 32bit and visa. I don't use the same pc to compile the script. Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
water Posted April 8, 2014 Author Share Posted April 8, 2014 Can you please replace "test@hotmail.com" with "test@hotmail.com;" and give it a try? 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...
Queener Posted April 8, 2014 Share Posted April 8, 2014 (edited) Can you please replace "test@hotmail.com" with "test@hotmail.com;" and give it a try? nope... I'm gonna play around with it more and see if I can come up with a work around. Do me a favorite and test my script and see if you get any error. EDIT: It was working all along... what happen was outlook need to be open for this script to work. Edited April 8, 2014 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
water Posted April 9, 2014 Author Share Posted April 9, 2014 Maybe the problem is caused by >this strange Outlook behaviour. Outlook is being closed when there is no open window and no reference to an Outlook item. 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...
water Posted April 9, 2014 Author Share Posted April 9, 2014 I think I found the bug! Please change line Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderOutbox) in function _OL_Wrapper_SendMail Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderDrafts) and the message will get sent even when Outlook was not running. Queener 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...
Queener Posted April 9, 2014 Share Posted April 9, 2014 (edited) "C:\Program Files (x86)\AutoIt3\Include\OutlookEx.au3" (1239) : ==> Variable must be of type "Object".: $oFolder = $oNamespace.GetDefaultFolder($iFolderType) $oFolder = $oNamespace^ ERROR works fine if outlook is open, but automatic close with error shown above if outlook isn't open. Experiences: The error lies on Lync is being open. After I closed Lync, it works fine. Is there a way you can impliment the code to check and use: Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderOutbox) Â if outlook is open and use: Â Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderDrafts) Â if outlook is close, but also check to make sure Lync is close before run the script? The lync process name is UcMapi.exe. Â The message does not send as well. It's stuck in quantine until you press send/receive. Â btw, good work Water. Edited April 9, 2014 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
water Posted April 9, 2014 Author Share Posted April 9, 2014 I tested on Windows 7 64 bit with Outlook 2010 and it works just fine. 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...
water Posted April 9, 2014 Author Share Posted April 9, 2014 The line I let you change was wrong anyway. A new mail item has to be created in the drafts folder and is only moved to the outbox folder when being sent. I have no Lync here so I can't test howLync and Outlook interact and what needs to be done to make the OutlookEX UDF run stable. 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...
Queener Posted April 9, 2014 Share Posted April 9, 2014 I see... Lync is personally using the .ost file which outlook is also using that file too. Maybe you can add a simple code to open outlook invisible just until the email is send out then close outlook. Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
water Posted April 9, 2014 Author Share Posted April 9, 2014 The code you posted in #73 doesn't do any error checking aftetr _OL_Open. Maybe it should look like: _OL_Open() If @error Then ; Try to close Lync and repeat _OL_Open EndIf 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...
dbs179 Posted April 10, 2014 Share Posted April 10, 2014 (edited) I'm having a similar problem with a Error sending mail (Error sending mail. @error=4000, @extended: 0). I'm on Windows 8.1 x64 and Outlook 2013 64 bit. If I open Outlook first the email creates and sends with attachments and priority flag. If Outlook is closed I get the error. Any help would be appreciated. Thanks, Dave #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=N #include <File.au3> #include <GUIConstants.au3> #include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <GUIToolTip.au3> #include <Array.au3> #include <Constants.au3> #include <Date.au3> #include <WinAPIFiles.au3> #include <MsgBoxUDF.au3> #include <ScreenCapture.au3> #include <OutlookEX.au3> #include <WinAPIFiles.au3> Global $iFileName, $Form1_1 Global $oOutlook = _OL_Open() GLobal $sTo = "Test1@gmail.com;" $Form1_1 = GUICreate("System Information", 1083, 638, 182, 114) GUISetState(@SW_SHOW) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) $iFileName = @DesktopDir & "\Utility Screenshot - " & @MON & "." & @MDAY & "." & @YEAR & " - (" & @HOUR & "." & @MIN & "." & @SEC & ").jpg" _ScreenCapture_CaptureWnd($iFileName, $Form1_1) Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_Wrapper_SendMail($oOutlook, $sTo, "", "", "Configuration Utility Screenshot", "Attached please find the Configuration Utilty Screenshot.<br>Automatically sent via the Configuration Utlity<br>Thank you, <br>" & $sCurrentUser, $iFileName, $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) Edited April 10, 2014 by dbs179 Link to comment Share on other sites More sharing options...
water Posted April 10, 2014 Author Share Posted April 10, 2014 Have you tried the solution I provided in post #87? 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...
dbs179 Posted April 10, 2014 Share Posted April 10, 2014 Have you tried the solution I provided in post #87? I did not, I thought it didn't apply. At any rate, I tried it and it works fine now. Thank you so much! Dave Link to comment Share on other sites More sharing options...
water Posted April 10, 2014 Author Share Posted April 10, 2014 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...
dbs179 Posted April 11, 2014 Share Posted April 11, 2014 water, I'm having one last issue. If outlook is closed, the code now finished but the email never sends. I don't get any errors either. Once I open outlook, the message is in my outbox waiting to be sent and sends fine, but it never sends unless I open outlook manually. If I already have outlook open everything works fine. Link to comment Share on other sites More sharing options...
water Posted April 11, 2014 Author Share Posted April 11, 2014 Does adding _OL_ItemSendReceive($oOutlook) before _OL_Close($oOutlook) help? 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...
dbs179 Posted April 11, 2014 Share Posted April 11, 2014 Does adding _OL_ItemSendReceive($oOutlook) before _OL_Close($oOutlook) help? Nope, still acts the same. Shows up in my outbox and sends as soon as I open outlook.. Link to comment Share on other sites More sharing options...
water Posted April 11, 2014 Author Share Posted April 11, 2014 Strange. Do you get any error messages when you insert _OL_ErrorNotify(2) before _OL_Open? 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...
Recommended Posts