Share via


Folders.FolderAdd Event

Outlook Developer Reference

Occurs when a folder is added to the specified Folders collection.

Syntax

expression.FolderAdd(Folder)

expression   A variable that represents a Folders object.

Parameters

Name Required/Optional Data Type Description
Folder Required Folder The Folder that is added.

Remarks

This event is not available in Microsoft Visual Basic Scripting Edition (VBScript).

Example

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

Visual Basic for Applications
  Public WithEvents myOlFolders As Outlook.Folders

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

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

See Also