Share via


FolderPath Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns a read-only String that indicates the path of the current folder.

expression.FolderPath

expression   Required. An expression that returns a MAPIFolder object.

Example

The following example displays information about the current folder. The subroutine accepts a MAPIFolder object and displays the folder's name, path, and address book information.

  
Sub Folderpaths()

    Dim olApp As Outlook.Application
    Dim nmsName As NameSpace
    Dim fldFolder As MAPIFolder

    Set olApp = Outlook.Application
    'Create namespace reference
    Set nmsName = olApp.GetNamespace("MAPI")
    'create folder instance
    Set fldFolder = nmsName.GetDefaultFolder(olFolderInbox)
    'call sub program
    Call FolderInfo(fldFolder)

End Sub

Sub FolderInfo(ByVal fldFolder As MAPIFolder)
'Displays information about a given folder

    MsgBox fldFolder.Name & "'s current path is " & fldFolder.FolderPath & _
             ". The current address book name is " & fldFolder.AddressBookName & "."

End Sub