Jump to content
Sign in to follow this  

Variable must be of type "Object"

Recommended Posts


Hi, folks. New guy on the block here. Have been using AutoIT for a very short time, and I'm needing to open Outlook, search for and open a message with a specific subject, save an attachment (CSV file) to the Desktop, then close/minimize Outlook and manipulate the file with Excel. Instead of using Run, WinActivate, etc., I was hoping to use COM instead, as it seemed more programmatic and less error-prone. However, I'm running into trouble right out of the chute. My first two statements are:

;Open Outlook:

$outlook = ObjCreate("Outlook.Application")


When I save and run this, though, I get the following error message in my output:

>Running:(\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\StoneS2\Desktop\FormatMECSV.au3"

C:\Documents and Settings\StoneS2\Desktop\FormatMECSV.au3 (22) : ==> Variable must be of type "Object".:


$outlook^ ERROR

I tried using the #include <IE.au3> at the beginning of the script, because I saw it in someone's example code somewhere. Didn't have any effect. (Couldn't imagine why it would have, but I'll try most things once.)

Any ideas, folks, about what I'm doing wrong? I've hit the forums here, MSDN, the AutoIT help files, and several other sources and can't figure out what I'm doing wrong. Incidentally, I'm using Outlook 2003 on Windows XP with all the latest SPs and patches.

Thanks in advance for any and all help...

Shawn Stone

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this