Kurto2021 Posted July 1, 2013 Share Posted July 1, 2013 Ok I have no idea how to get this to do what I want. I am now able to parse data from the email but next step is to then move the email over to a new folder. I am using #include <OutlookEX.au3> to open outlook and once complete I just want to move the email so I don't keep processing the same file over and over again. $inbox and $inbox success are variables assigned earlier that just point to a folder in my mail inbox. $auOutlook = _OL_Open() ; Open outlook $auOutlookCount = _OL_ItemFind($auOutlook,$inbox,$olMail,"","","","","",4) ; $auOutlookItems = _OL_ItemFind($auOutlook,$inbox,$olMail,"","","","EntryID") $Success = _OL_FolderAccess($auOutlook, $inboxsuccess) $oItem = _OL_ItemMove($auOutlook, $auOutlookItems, $inbox, $success) Here is the info from the file where it gives me the required parameters. Name ..........: _OL_ItemMove ; Syntax.........: _OL_ItemMove($oOL, $vItem, $sStoreID, $vTargetFolder[, $iFolderType = Default]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() $vItem - EntryID or object of the item to move $sStoreID - StoreID of the source store as returned by _OL_FolderAccess. Use "Default" to access the users mailbox $vTargetFolder - Target folder object as returned by _OL_FolderAccess or full name of folder $iFolderType - Optional: Type of target folder if you specify the folder name of another user. Is defined by the Outlook OlDefaultFolders enumeration (default = Default) Link to comment Share on other sites More sharing options...
Kurto2021 Posted July 1, 2013 Author Share Posted July 1, 2013 (edited) I thought I was closer as it appears that _OL_FolderAccess returns an array with the following values Return values .: Success - one-dimensional one based array with the following information: 1 - Object to the folder 2 - Default item type (integer) for the specified folder. Defined by the Outlook OlItemType enumeration 3 - StoreID (string) of the store to access the folder by ID 4 - EntryID (string) of the folder to access the folder by ID 5 - Folderpath (string) I tried this....but still no luck....I think storeid is correct but the vItem is still not right.....the second parameter is the issue ... I think $auOutlook = _OL_Open() ; Open outlook $auOutlookCount = _OL_ItemFind($auOutlook,$inbox,$olMail,"","","","","",4) ; $auOutlookItems = _OL_ItemFind($auOutlook,$inbox,$olMail,"","","","EntryID") $Success = _OL_FolderAccess($auOutlook, $inboxsuccess) $oItem = _OL_ItemMove($auOutlook, $success[4], $success[3], $inboxsuccess) Edited July 1, 2013 by Kurto2021 Link to comment Share on other sites More sharing options...
water Posted July 1, 2013 Share Posted July 1, 2013 Try: $oOutlook = _OL_Open() ; Open outlook $aOutlookItems = _OL_ItemFind($auOutlook, $inbox, $olMail,"","","","EntryID") $iOutlookCount = $aOutlookItems[0][0] $aSuccess = _OL_FolderAccess($auOutlook, $inboxsuccess) $oItem = _OL_ItemMove($oOutlook, $aOutlookItems[$i][0], Default, $aSuccess[1]) You don't need to run _OL_ItemFind twice to get the item count and the items. 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...
Kurto2021 Posted July 3, 2013 Author Share Posted July 3, 2013 water you rule!!!! Of course now I am being asked to add the word completed to the beginning of the subject when I move it. Ugh.....you get one thing to work and they ask for more. Link to comment Share on other sites More sharing options...
water Posted July 3, 2013 Share Posted July 3, 2013 That's easy: Use _OL_ItemGet to retrieve the subject and _OL_ItemModify to set the subject. Use the item object returned bei _OL_ItemMove to access the moved item. 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...
Kurto2021 Posted July 3, 2013 Author Share Posted July 3, 2013 (edited) says the man who wrote the UDF That's easy: so I figured I would change the subject then move it I was thinking I was on the right track but not sure what to do with the returned values from itemget and what to fill in to do about $sp1 $itemget = _OL_ItemGet($auOutlook, $auOutlookItems[1][0], Default, Default) _OL_ItemModify($auOutlook, $auOutlookItems[1][0], Default, $sP1 = "") Edited July 3, 2013 by Kurto2021 Link to comment Share on other sites More sharing options...
water Posted July 3, 2013 Share Posted July 3, 2013 But I hope it is easy for you too 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...
Kurto2021 Posted July 3, 2013 Author Share Posted July 3, 2013 I can't get it to work...Just not sure what I am doing wrong Link to comment Share on other sites More sharing options...
Solution water Posted July 3, 2013 Solution Share Posted July 3, 2013 I modified my last example: $oOutlook = _OL_Open() ; Open outlook $aOutlookItems = _OL_ItemFind($auOutlook, $inbox, $olMail,"","","","EntryID") $iOutlookCount = $aOutlookItems[0][0] $aSuccess = _OL_FolderAccess($auOutlook, $inboxsuccess) $aProperties = _OL_ItemGet($oOL, $aOutlookItems[$i][0], Default, "Subject") $sSubject = "[Moved] " & $aProperties[1][1] _OL_ItemModify($oOL, $aOutlookItems[$i][0], Default, "Subject=" & $sSubject) $oItem = _OL_ItemMove($oOutlook, $aOutlookItems[$i][0], Default, $aSuccess[1]) 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...
Kurto2021 Posted July 4, 2013 Author Share Posted July 4, 2013 I was close only needed to add subject to the itemget then add word subject= to the modify ..... $itemget = _OL_ItemGet($auOutlook, $auOutlookItems[1][0], Default, "subject") $auitemget = "ADD SOMETHING HERE " & $itemget _OL_ItemModify($auOutlook, $auOutlookItems[1][0], Default, "Subject=" & $auitemget) Water thanks for your help Link to comment Share on other sites More sharing options...
water Posted July 4, 2013 Share Posted July 4, 2013 Glad to be of service 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...
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