Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

BodyPart Property

Exchange Server 2003

BodyPart 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.

The IBodyPart interface on this object. This property is read-only.

Applies To

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

        [Visual Basic]Property BodyPart As IBodyPart
        [C++]HRESULT get_BodyPart(IBodyPart** pVal);

Parameters

pVal
Returned reference to an IBodyPart Interface.

Remarks

This property returns the IBodyPart interface on the object, and acts as shorthand in place of standard interface navigation such as QueryInterface or the IMessage.GetInterface method used by scripting languages.

Examples

        [Visual Basic]

Dim iMsg As New CDO.Message
Dim iBp As CDO.IBodyPart ' for IBodyPart on message

   'Get IBodyPart using BodyPart property
Set iBp = iMsg.BodyPart

Set iBp = Nothing ' Release
   ' Get IBodyPart using QI
Set iBp = iMsg

Set iBp = Nothing ' Release

        [C++]

/*
 You must have the following paths in your
 INCLUDE path.
 %CommonProgramFiles%\system\ado
 %CommonProgramFiles%\microsoft shared\cdo

*/
#ifndef _CORE_EXAMPLE_HEADERS_INCLUDED
#define _CORE_EXAMPLE_HEADERS_INCLUDED
#import <msado15.dll> no_namespace
#import <cdoex.dll> no_namespace
#include <iostream.h>
#endif

void IMessage_BodyPart_Example() {

   /*
   ** When using C++, avoid the interface
   ** properties and access the object's
   ** interface directly.
   */
   IBodyPart*   pBp   =   NULL;
   HRESULT hr = CoCreateInstance(
      __uuidof(Message),
      NULL,
      CLSCTX_SERVER,
      __uuidof(IBodyPart),
      (void**)&pBp);

   // ...

   pBp->Release();

}
Show:
© 2015 Microsoft