Platform SDK: Exchange 2000 Server

Description Property

[This is preliminary documentation and subject to change.]

A description of the folder.

[Visual Basic,VBScript]
Property Description as String
[C++]
HRESULT get_Description(BSTR* pVal);
HRESULT put_Description(BSTR Val);
IDL]
HRESULT [propget] Description([out,retval] BSTR* pVal);
HRESULT [propput] Description([in] BSTR Val);

Remarks

This property is normally set by administrators to provide an administrative note for the folder.

Example

[Visual Basic]
' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Exchange 2000 Library

Function CreateFolder( Url as String, _
                       ContentClass as String, _
                       Description as String ) 
  Set Fldr = New CDO.Folder
  With Fldr
    .ContentClass = ContentClass
    .Description  = Description
    .DataSource.SaveTo Url, , _
                       adModeReadWrite, _
                       adCreateCollection Or adCreateOverWrite

  End With
  Set CreateFolder = Fldr

End Function
[VBScript]
Const adModeReadWrite    = 3
Const adCreateCollection = 8192
Const adCreateOverwrite  = 67108864

Function CreateFolder( Url, ContentClass, Description ) 
  Set Fldr = CreateObject("CDO.Folder")
  With Fldr
    .ContentClass = ContentClass
    .Description  = Description
    .DataSource.SaveTo Url, , _
                       adModeReadWrite, _
                       adCreateCollection Or adCreateOverWrite

  End With
  Set CreateFolder = Fldr

End Function
[C++]
HRESULT CreateFolder(BSTR Url, BSTR contentclass, BSTR Description, IFolder** ppFldr) {

   /* Assume these headers:
   *
   * #import <msado15.dll> no_namespace
   * #import <cdoex.dll>   no_namespace
   *
   */

   if(ppFldr == NULL)
      return E_POINTER;

   IDataSource* pDsrc = NULL;
   HRESULT hr = CoCreateInstance(
      __uuidof(Folder),
      NULL,
      CLSCTX_INPROC_SERVER,
      __uuidof(IFolder),
      reinterpret_cast<void**>(ppFldr));

   if(FAILED(hr)) 
      return hr;

   hr = (*ppFldr)->put_ContentClass(contentclass);
   hr = (*ppFldr)->put_Description(Description);

   if(FAILED(hr)) {
      (*ppFldr)->Release();
      *ppFldr = NULL;
      return E_UNEXPECTED;
   }

   hr = (*ppFldr)->QueryInterface(
      __uuidof(IDataSource),
      reinterpret_cast<void**>(&pDsrc));

   if(FAILED(hr)) {
      (*ppFldr)->Release();
      *ppFldr = NULL;
      return E_UNEXPECTED;
   }

   hr = pDsrc->raw_SaveTo(
      Url,
      NULL,
      adModeReadWrite,
      (RecordCreateOptionsEnum) 
         (   adCreateCollection | 
            adCreateOverwrite
         ),
      adOpenSource,
      NULL,
      NULL);

   if(FAILED(hr)) {
      (*ppFldr)->Release();
      *ppFldr = NULL;
   }

   pDsrc->Release();
   pDsrc = NULL;
   return hr;
}