Jump to content

Recommended Posts

Posted

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.853

Can anyone help show me what I'm doing wrong? Thanks in advance.

Posted

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:

  Reveal hidden contents

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...