I've found this:
It move every categorised email to a specific folder (urgent ou boulot).
beware: this script freeze outlook a long time to achieve the operation.
I need to link it with the event "user has check a new email in a specific folder"... if you know how, tell me
Sub MoveItems()
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.Folder
Dim myItems As Outlook.Items
Dim myRestrictItems As Outlook.Items
Dim myItem As Outlook.MailItem
Dim racine As Outlook.Folder
Set myNamespace = Application.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetFolderFromID(ActiveExplorer.Current Folder.EntryID)
Set myItems = myFolder.Items
Set racine = myFolder.Parent
Set myRestrictItems = myItems.Restrict("[Catégories] = 'urgent ou boulot'")
For i = myRestrictItems.Count To 1 Step -1
myRestrictItems(i).Move racine.Folders("urgent ou boulot")
Next
End Sub



LinkBack URL
About LinkBacks






Bookmarks