How to refer to a sub folder of outlook with VBA

Pedro Reis 1 Reputation point
2022-02-22T16:59:59.463+00:00

I need to refer to a sub-folder of outlook with VBA, how can I do It? I will insert some prints to help177000-capturar.png

177054-capturar.png

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,243 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kinuasa 366 Reputation points
    2022-02-25T05:47:44.08+00:00

    Hi,
    I think you can refer to it from the Folders object.

    Public Sub Sample()
      Dim fol As Outlook.Folder
      With Application.Session.GetDefaultFolder(olFolderInbox)
        Set fol = .Folders.Item("BTG")
        Debug.Print fol.Items.Count
      End With
    End Sub
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.