-2

My Outlook Inbox Folder have plenty of items. I want move these to a specific Folder via VBA. I not found a method to move item to a folder. I need your help. Thanks

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

1 Answers1

0

Do you want to move Inbox item to a specific folder?

You could use Move method to move a Microsoft Outlook item to a new folder. For example:

Sub MoveItems() 
 Dim myNameSpace As Outlook.NameSpace 
 Dim myInbox As Outlook.Folder 
 Dim myDestFolder As Outlook.Folder 
 Dim myItems As Outlook.Items 
 Dim myItem As Object 

 Set myNameSpace = Application.GetNamespace("MAPI") 
 Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) 
 Set myItems = myInbox.Items 
 Set myDestFolder = myInbox.Folders("Personal Mail") 
 Set myItem = myItems.Find("[SenderName] = 'Eugene Astafiev'") 
 While TypeName(myItem) <> "Nothing" 
  myItem.Move myDestFolder 
  Set myItem = myItems.FindNext 
 Wend 
End Sub

For more information, Please refer to this link:

VBA to move read emails to specific folders

Alina Li
  • 884
  • 1
  • 6
  • 5