Platform SDK: Exchange 2000 Server

BodyPart Property

[This is preliminary documentation and subject to change.]

The IBodyPart interface on this object.

[Visual Basic]
Property BodyPart as IBodyPart
read-only
[C++]
HRESULT get_BodyPart(IBodyPart** pVal);
[IDL]
HRESULT [propget] BodyPart([out,retval] IBodyPart** pVal);

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.

Example

[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++,IDL]
#include "cdoex.h"
#include "cdoex_i.c"
void main(){
  CoInitialize(NULL);
  IMessage* Msg = NULL;
  CoCreateInstance(CLSID_Message,
                   NULL,
                   CLSCTX_INPROC_SERVER,
                   IID_IMessage,
                   reinterpret_cast<void**>(&Msg));
  IBodyPart* Bp = NULL;

  // Get IBodyPart using the property  
  Msg->get_BodyPart(&Bp);
  Bp->Release();
  // Get IBodyPart using QI
  Msg->QueryInterface(IID_IBodyPart,
                      reinterpret_cast<void**>(&Bp));
  Bp->Release();
  Msg->Release();
   // ... 
  CoUninitialize();
 }