FolderAdd Event

Occurs when a folder is added to the specified Folders collection. This event is not available in Microsoft Visual Basic Scripting Edition (VBScript).

Subobject**_FolderAdd(ByVal Folder As MAPIFolder)**

*object   * An expression that evaluates to a Folders collection object.

Folder Required. The MAPIFolder that was added to the collection.


The following Microsoft Visual Basic/Visual Basic for Applications (VBA) example displays a new folder created in the user's Inbox folder.

Dim myOlApp As New Outlook.Application
Public WithEvents myOlFolders As Outlook.Folders

Public Sub Initialize_handler()
    Set myOlFolders = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders
End Sub

Private Sub myOlFolders_FolderAdd(ByVal Folder As Outlook.MAPIFolder)
End Sub

Applies to | Folders Object

See Also | FolderChange Event | FolderRemove Event | FolderSwitch Event | MAPIFolder Object | Using events with Automation