Sdílet prostřednictvím


Parent Property

Returns the parent Object of the specified object. Read-only.

expression**.Parent**

*expression   * Required. An expression that returns a Microsoft Outlook object.

Example

This Visual Basic for Applications (VBA) example displays the folders in the parent folder of Inbox.

Sub GetRootFolder()
    Dim mpfRoot As Outlook.MAPIFolder
    Dim mpf As Outlook.MAPIFolder
    Dim idx As Integer
    
    Set mpf = Application.Session.GetDefaultFolder(olFolderInbox)
    Set mpfRoot = mpf.Parent
    For idx = 1 To mpfRoot.Folders.count
        MsgBox mpfRoot.Folders.Item(idx).Name
    Next
    
End Sub

Applies to | Action Object | Actions Object | AddressEntries Object | AddressEntry Object | AddressList Object | AddressLists Object | Application Object | AppointmentItem Object | Attachment Object | Attachments Object | Conflict Object | Conflicts Object | ContactItem Object | DistListItem Object | DocumentItem Object | Exception Object | Exceptions Object | Explorer Object | Explorers Object | Folders Object | FormDescription Object | Inspector Object | Inspectors Object | ItemProperties Collection | ItemProperty Object | Items Object | JournalItem Object | Link Object | Links Object | MailItem Object | MAPIFolder Object | MeetingItem Object | NameSpace Object | NoteItem Object | OutlookBarGroup Object | OutlookBarGroups Object | OutlookBarPane Object | OutlookBarShortcut Object | OutlookBarShortcuts Object | OutlookBarStorage Object | Pages Object | Panes Object | PostItem Object | PropertyPages Object | PropertyPageSite Object | Recipient Object | Recipients Object | RecurrencePattern Object | Reminder Object | Reminders Collection | RemoteItem Object | ReportItem Object | Results Collection | Search Object | Selection Object | SyncObject Object | SyncObjects Object | TaskItem Object | TaskRequestAcceptItem Object | TaskRequestDeclineItem Object | TaskRequestItem Object | TaskRequestUpdateItem Object | UserProperties Object | UserProperty Object | View Object | Views Collection