MohanRatnam Posted March 13, 2015 Share 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 Link to comment Share on other sites More sharing options...
water Posted March 13, 2015 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted March 13, 2015 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
MohanRatnam Posted March 13, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
MohanRatnam Posted March 13, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
water Posted March 13, 2015 Share Posted March 13, 2015 I will test as soon as I return to my office. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
MohanRatnam Posted March 20, 2015 Author Share Posted March 20, 2015 Hello water, was wonderin if there was any progress on this? Link to comment Share on other sites More sharing options...
water Posted March 20, 2015 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
MohanRatnam Posted March 20, 2015 Author Share Posted March 20, 2015 water, thank you very much for all your help. Link to comment Share on other sites More sharing options...
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