Hello guys,
I want to move encrypted emails. But I find that the "object. move" function does not work on ecrypted emails. All suggestion about the right code?
Hello guys,
I want to move encrypted emails. But I find that the "object. move" function does not work on ecrypted emails. All suggestion about the right code?
Welcome to VBAX. This issue comes up regularly. What code have you been trying?
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
To move encrypted emails, use the Copy and Delete methods instead of Move. Here’s a quick code example:
Replace "YourTargetFolder" with your actual target folder name.Sub MoveEncryptedEmails() Dim sourceFolder As Outlook.MAPIFolder Dim targetFolder As Outlook.MAPIFolder Dim item As Object Set sourceFolder = Application.Session.GetDefaultFolder(olFolderInbox) Set targetFolder = Application.Session.Folders("YourTargetFolder") For Each item In sourceFolder.Items If item.Class = olMail And item.PropertyAccessor.GetProperty("http://schemas.microsoft.com/ _ mapi/proptag/0x7D01001E") = "IPM.Note.SMIME.MultipartSigned" Then item.Copy targetFolder item.Delete End If Next End Sub
I have no experience with Outlook vba, so if I ever saw this string ("http://schemas.microsoft.com/ _
mapi/proptag/0x7D01001E") = "IPM.Note.SMIME.MultipartSigned") used somewhere, does it indicate the email is definitely encrypted?
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link