Compartir a través de


DataSource Property (IBodyPart)

Topic Last Modified: 2006-06-13

Returns the IDataSource Interface on the 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 DataSource As IDataSource
HRESULT get_DataSource(IDataSource** pVal);

Parameters

Remarks

This property returns the IDataSource interface on the object. If the object does not implement the IDataSource interface, the Component Object Model (COM) exception E_NOTIMPL is raised.

This property is intended to provide a mechanism for interface navigation with scripting languages that do not natively support interface navigation. For programming languages such as C++, Microsoft® Visual Basic®, and Microsoft Visual J++®, the preferred way to navigate to the IDataSource interface on an object is to use native mechanisms, namely QueryInterface, the Set keyword, or type casting respectively. However, the DataSource property is valid to use from these languages as well.

Examples


Dim iMsg as New CDO.Message
Dim iDSrc as CDO.IDataSource

' The native way
Set iDSrc = iMsg 
Set iDSrc = Nothing

' This works as well.
Set iDSrc = Bp.DataSource  


Dim iMsg
Dim iBp
Set iMsg = CreateObject("CDO.Message")
Dim iDSrc

' Navigate to DataSource in VBScript
Set iDSrc = iBp.DataSource