VBA - Instead of ActiveExplorer.Selection to set folder, explicitly set folder path
- by Mike
Sub MoveItems()
Dim Messages As Selection
Dim Msg As MailItem
Dim NS As NameSpace
Set NS = Application.GetNamespace("MAPI")
Set Messages = ActiveExplorer.Selection
If Messages.Count = 0 Then
Exit Sub
End If
For Each Msg In Messages
Msg.Move NS.Folders("Personal Folders").Folders("SavedMail")
Next
End Sub
This code will…