Sign in to follow this  
Followers 0
Gumma

Outlook UDF

2 posts in this topic

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.

Share this post


Link to post
Share on other sites



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0