Create a Set of Subfolders

For a project based filing system you often have to create the same subfolders for every new project folder. You can create any number of subfolders at once with a macro.

Last modified: 2015/05/06 | Accessed: 32.388  | #145
◀ Previous sample Next sample ▶
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.

This sample adds four subfolders to the current folder. Edit the list to add the folders you need. The first array argument holds the folder name in quotation marks, the second one holds the folder type.

If you don't see every new folder after running the macro, press CTRL+6 in order to display the folder list. You can start the macro, for instance, by pressing ALT+F8.

tip  How to add macros to Outlook
Public Sub CreateSubfolders()
  Dim CurrentFolder As Outlook.MAPIFolder
  Dim Subfolder As Outlook.MAPIFolder
  Dim List As New VBA.Collection
  Dim Folders As Outlook.Folders
  Dim Item As Variant
  List.Add Array("Messages", olFolderInbox)
  List.Add Array("Appointments", olFolderCalendar)
  List.Add Array("Team", olFolderContacts)
  List.Add Array("ToDo", olFolderTasks)
  Set CurrentFolder = Application.ActiveExplorer.CurrentFolder
  Set Folders = CurrentFolder.Folders
  For Each Item In List
    Folders.Add Item(0), Item(1)
End Sub
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
email  Send a message