There's no need to maintain a giant dictionary of every email you've seen if you are processing emails in a deterministic order (e.g. Here's a script that takes advantage of sorting emails to check for duplicates much more efficiently. MsgBox "duplicate items were removed to ""removed items""", vbCritical, "See " & strPath & " for details" ObjTF.WriteLine Replace(objItem.Subject, ", ", Chr(32)) StrCheck = Replace(strCheck, ", ", Chr(32)) StrCheck = objItem.Subject & "," & objItem.Body & "," If olFolder2 Is Nothing Then Set olFolder2 = ("removed items")įor lngCnt = To 1 Step -1 Set olFolder2 = olFolder.Folders("removed items") Set objTF = objFSO.CreateTextFile(strPath) Set objFSO = CreateObject("scripting.filesystemobject") Set objDic = CreateObject("scripting.dictionary") Tested on Outlook 2016 Const strPath = "c:\temp\deleted msg.csv" I have changed the test to subject and body Updated: Checking for size surprisingly missed a number of dupes, even for otherwise identical mail items. Create a CSV file - stored under the path in StrPath to create a external reference to Outlook of the emails that have been moved.Moved (rather than delete) any duplicates into a sub-folder ( removed items) of the folder being processed.Checks duplicates on the base of Subject, Sender, CreationTime and Size.Provides users with a prompt to select the folder to process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |