Parent Property

Topic Last Modified: 2006-06-13

Returns the parent body part object. This property is read-only.

Applies To

IBodyPart Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

Property Parent As IBodyPart
HRESULT get_Parent(IBodyPart** pVal);

Parameters

Remarks

Message content that is more than plain US-ASCII is arranged in a parent-child hierarchy. You can use the Parent property to navigate up from the current object to the object one level higher. If the object has no parent, as in the case with the Message object, an exception is raised.

As noted earlier, the Parent object may or may not be an instance of the BodyPart Component Object Model (COM) class.

Example


Dim iMsg As New CDO.Message
Dim iBp1 As CDO.IBodyPart
Dim iBp2 As CDO.IBodyPart

Set iBp1 = iMsg.AddAttachment("c:\files\file.doc")
Set iBp2 = iBp1.Parent

' The IBodyPart interface is now on the Message object, as it
' is the parent of the attachment BodyPart object.