get_Fields
Returns the Items Field Collection
In addition, the item allows
access to seperate fields as properties of the object itself. A field can be addressed via their ID in the fields collection.
List of defined field IDs: Field ID's
Midl:
IDispatch* Fields();
Syntax:
HRESULT Fields([out, retval] IDispatch** lppFields);
[out]lppFields: contains the Fields object
Example:
VARIANT vIndex;
Archive* pArchive = NULL;
MessageItems* pMessageItems = NULL;
MessageItem* pMessageItem = NULL;
FaxItem* pFaxItem = NULL;
Fields* pFields = NULL;
Field* pField = NULL;
vIndex.vt = VT_I4;
if (SUCCEEDED (pAcc->GetSpecialArchive(DvArchivePersonalIn,&pArchive)) )
{
if (SUCCEEDED(pArchive->get_AllItems(&pMessageItems)))
{
vIndex.lVal = 1;
if (SUCCEEDED(pMessageItems->Item(vIndex, &pMessageItem)))
{
if (SUCCEEDED(pMessageItem->QueryInterface(IID_FaxItem,(void**)&pFaxItem)))
{
if (SUCCEEDED (pFaxItem->get_Fields((LPDISPATCH)&pFields)))
{
VARIANT vt;
vt.vt = VT_I4;
vt.lVal = Field_FullnameFrom;
if (SUCCEEDED (pFields->Item(vt, &pField)))
{
VariantInit(&vt);
pField->get_Value(&vt);
...
pField->Release ();
}
pFields->Release ();
}
}
pMessageItem->Release();
}
pMessageItems->Release();
}
pArchive->Release();
}