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
Asked
Active
Viewed 199 times
-2
-
https://stackoverflow.com/a/29910853/4539709 – 0m3r Oct 29 '18 at 19:26
1 Answers
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:

Alina Li
- 884
- 1
- 6
- 5