Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8438155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:37:49+00:00 2026-06-10T07:37:49+00:00

How can I enter a string as a folder location ex. \MySpecificEmailAddress\Inbox To select

  • 0

How can I enter a string as a folder location
ex. \MySpecificEmailAddress\Inbox
To select that folder in VBA using outlook?
I obtained the path using:

... = ActiveExplorer.CurrentFolder.FolderPath

I have searched far and wide to automatically tell the script which specific folder to run a macro on without having to select the folder then run the script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:37:50+00:00Added an answer on June 10, 2026 at 7:37 am

    You should be able to enumerate Session.Stores and then Store.GetRootFolder.Folders to access all folders for a given mailbox. Depending on how many levels deep you need to go, this may take a bit more effort (i.e. recursion).

    Here is a code snippet from MSDN which enumerates all folders under the mailbox/store root folders:

    Sub EnumerateFoldersInStores()  
     Dim colStores As Outlook.Stores 
     Dim oStore As Outlook.Store 
     Dim oRoot As Outlook.Folder 
    
     On Error Resume Next 
    
     Set colStores = Application.Session.Stores  
     For Each oStore In colStores 
       Set oRoot = oStore.GetRootFolder 
       Debug.Print (oRoot.FolderPath) 
       EnumerateFolders oRoot 
     Next 
    
    End Sub 
    
    Private Sub EnumerateFolders(ByVal oFolder As Outlook.Folder) 
     Dim folders As Outlook.folders 
     Dim Folder As Outlook.Folder 
     Dim foldercount As Integer 
    
     On Error Resume Next 
     Set folders = oFolder.folders 
     foldercount = folders.Count 
     'Check if there are any folders below oFolder 
      If foldercount Then 
        For Each Folder In folders 
          Debug.Print (Folder.FolderPath) 
          EnumerateFolders Folder 
        Next 
     End If 
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a textbox that a user can enter an arbitrary string
On a site I'm doing a user can enter a search string like do
I know that i can enter/add new properties via code manually into partial classes
I have a form where a user can enter the number of students that
I'm using the below script to search and replace string in a folder. How
I am developing a test software where the user can enter a string where
I have program that asks to enter a string (mystring) and a char (ch).
I have made an normal form that you can enter a user´s fullname in
I have a TextBox that user can enter search-term in it. Its bind to
I created silver-light 4.0 application in that user can enter their username and password.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.