for each item in folder outlook vba

The solution for “for each item in folder outlook vba” can be found here. The following code will assist you in solving the problem.

Sub ListMailsInFolder()

Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder

Set objNS = GetNamespace(“MAPI”)
Set objFolder = objNS.Folders.GetFirst ‘ folders of your current account
Set objFolder = objFolder.Folders(“Foldername”).Folders(“Subfoldername”)

For Each Item In objFolder.Items
If TypeName(Item) = “MailItem” Then
‘ … do stuff here …
Debug.Print Item.ConversationTopic
End If

End Sub

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts