PDA

View Full Version : Move an encrypted email



lsheetrit45
04-07-2011, 07:39 AM
Hello,

I need some help moving encrypted emails.

For some reason the "object.move" function does not work on ecrypted emails. All help/advice is appreciated.


Here's my code in case you are interested (works great for non-encrypted emails):




Sub MoveToArchive()

On Error Resume Next
Dim objFolder As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim objItem As Object
Set objNS = Application.GetNamespace("MAPI")

'determine mail folder to mave files to
Set objFolder = objNS.PickFolder


'loop through objects and move them to the folder selected if object is unread and unflagged
For Each objItem In Application.ActiveExplorer.CurrentFolder.Items
If objItem.UnRead = False And objItem.FlagStatus <> 2 Then
objItem.Move objFolder
End If
Next


Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
End Sub