MohanRatnam Posted March 13, 2015 Posted March 13, 2015 Hello, I'm trying to do some work using the Outlook UDF. I can't figure out how to move email which I have just sent from the sent folder to another folder which I have created. As you can guess, I'm no expert so please bear with me. Here's my code Global $oOutlook = _OL_Open() $oItem = _OL_Wrapper_SendMail($oOutlook, "blahblah@outlook.com", "", "", "New Requisition", "") _OL_ItemMove($oOutlook, $oItem, "*\Sent Items", "*\Requisitions\1. Submitted") when i run it falls over with this error message "C:\Program Files\AutoIt3\Include\OutlookEX.au3" (3125) : ==> Variable must be of type "Object".: If $oSourceFolder.DefaultItemType <> $vTargetFolder.DefaultItemType Then Return SetError(2, 0, 0) If $oSourceFolder^ ERROR Thanks
water Posted March 13, 2015 Posted March 13, 2015 Which version of AutoIt do you run? Which version of the OutlookEX UDF do you use? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted March 13, 2015 Posted March 13, 2015 I think _OL_ItemMove should look like: _OL_ItemMove($oOutlook, $oItem, Default, "*\Requisitions\1. Submitted") My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
MohanRatnam Posted March 13, 2015 Author Posted March 13, 2015 According to the front page of the Autoit helpfile I have ver v3.3.12.0. Outlook Ex UDF is ver 1.0.0.0
MohanRatnam Posted March 13, 2015 Author Posted March 13, 2015 I have tried with the code _OL_ItemMove($oOutlook, $oItem, Default, "*\Requisitions\1. Submitted") and still get the same error message
water Posted March 13, 2015 Posted March 13, 2015 I will test as soon as I return to my office. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
MohanRatnam Posted March 20, 2015 Author Posted March 20, 2015 Hello water, was wonderin if there was any progress on this?
water Posted March 20, 2015 Posted March 20, 2015 Ops, sorry, I forgot to post my findings- The problem is caused by the fact that $oItem no longer exists - because it has been sent. The item created in the "Sent Mails" folder has got a different EntryID. So to move the item from the "Sent Mails" folder you either need to use _OL_ItemFind and search by subject, recipient, date etc. or use an event to wait for a new mail item to arrive in the "Sent Mails" folder. An example can be found in the Example Scripts section (a link can be found in my signature). My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
MohanRatnam Posted March 20, 2015 Author Posted March 20, 2015 water, thank you very much for all your help.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now