Gumma 0 Posted October 20, 2010 A few little tidbits about my system:I'm working with WinXP and Outlook 2007.I am just playing with the following script but I can't figure out exactly what I'm doing wrong. I've used other UDFs for word, excel, etc but I can't seem to get this to work.Here's the script:#Include <Date.au3> #Include <Array.au3> #Include "C:\Documents and Settings\username\Desktop\Outlook\Outlook.au3" Local $oOutlook, $test, $test2 $test2 = _OutlookOpen() _OutlookOpen() sleep(100) $test= _OutlookSendMail($oOutlook, "email@email.org", "", "", "test", "this is the body") _OutlookSendMail($oOutlook, "email@email.org", "", "", "test", "this is the body") msgbox(0,0,$test & $test2)I just created those two variables to see if I was getting any results or anything, but it doesn't even get me that far. When I read the syntax, it seems like I should be doing it correctly but I get this error:>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\SendMail Test.au3" C:\Documents and Settings\dlenaker\Desktop\Outlook\Outlook.au3 (420) : ==> Error in expression.:Local $oMessage = $oOutlook.CreateItem($olMailItem)Local $oMessage = ^ ERROR->13:16:27 AutoIT3.exe ended.rc:1+>13:16:28 AutoIt3Wrapper Finished>Exit code: 1 Time: 1.853Can anyone help show me what I'm doing wrong? Thanks in advance. Share this post Link to post Share on other sites
water 2,387 Posted October 21, 2010 Why do you call the functions twice? Your code should look like: #Include <Date.au3> #Include <Array.au3> #Include "C:\Documents and Settings\username\Desktop\Outlook\Outlook.au3" Local $oOutlook, $iresult $oOutlook = _OutlookOpen() sleep(100) $iResult= _OutlookSendMail($oOutlook, "email@email.org", "", "", "test", "this is the body") msgbox(0,"Outlook SendMail","Returncode: " & $iResult) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites