Add Method (Folders Object)

Applies To

Folders collection object.

Description

Creates a new folder in the Folders collection, and returns the new folder as a MAPIFolder object.

Syntax

expression.Add(Name, Type)

expression An expression that returns a Folders object.

Name Required String. The display name for the new folder.

Type Optional Long. The Outlook folder type for the new folder. Can be one of the following OlDefaultFolders constants: olFolderCalendar, olFolderContacts, olFolderInbox, olFolderJournal, olFolderNotes, or olFolderTasks. (The constants olFolderDeletedItems, olFolderOutbox, and olFolderSentMail cannot be specified for this argument.)

Example

This example adds the new folder named "My Contacts" to the current (default) Contacts folder.

Set myFolder = olNamespace.GetDefaultFolder(olFolderContacts)
Set myNewFolder = myFolder.Folders.Add("My Contacts")