G
gorbunok
I wrote a macro that searches all the personal Folders for a
conversation
that a new message in Inbox belongs to. If it finds it it moves it
there.
It works pretty good except that pretty often an error message pops up
that says
Actioned Failed and my macro get disabled in the rules wizard.. the
code is bellow. I can't find a way to debug this
Sub NewMessageMoveByThread(mail As Outlook.MailItem)
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myPersonalFolder = myNamespace.Folders.Item("Personal
Folders")
Set allPersonalFolders = myPersonalFolder.Folders
If mail.UnRead And (Trim(mail.Subject) <> "" Or
Trim(mail.Subject) <> "Re:") Then
For Each folder In allPersonalFolders
If Not folder.Name = "Deleted Items" Then
If Not
TypeName(folder.Items.Find("[ConversationTopic] = """ &
mail.ConversationTopic & """")) = "Nothing" Then
mail.Move folder
Exit For
End If
End If
Next
End If
End Sub
conversation
that a new message in Inbox belongs to. If it finds it it moves it
there.
It works pretty good except that pretty often an error message pops up
that says
Actioned Failed and my macro get disabled in the rules wizard.. the
code is bellow. I can't find a way to debug this
Sub NewMessageMoveByThread(mail As Outlook.MailItem)
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myPersonalFolder = myNamespace.Folders.Item("Personal
Folders")
Set allPersonalFolders = myPersonalFolder.Folders
If mail.UnRead And (Trim(mail.Subject) <> "" Or
Trim(mail.Subject) <> "Re:") Then
For Each folder In allPersonalFolders
If Not folder.Name = "Deleted Items" Then
If Not
TypeName(folder.Items.Find("[ConversationTopic] = """ &
mail.ConversationTopic & """")) = "Nothing" Then
mail.Move folder
Exit For
End If
End If
Next
End If
End Sub