AnnRTFText example for C++ Builder
// This sample loads a rich text annotation object with text
//It illustrates how AnnRTFText can treat the text as Rich Text, or plain text
// hObject: the Rich Text annotation object
// uFormat: the format of the retrieved text--one of
// RTFFORMAT_TEXT
// RTFFORMAT_RTF
void TForm1::ExampleAnnRTFText (HANNOBJECT hObject, L_UINT uFormat )
{
AnsiString strText;
AnsiString strFormat;
switch(uFormat)
{
case RTFFORMAT_TEXT:
strFormat = "Format: RTFFORMAT_TEXT";
break;
case RTFFORMAT_RTF:
strFormat = "Format: RTFFORMAT_RTF";
break;
default:
break;
}
strText= LEADAnn1->AnnRTFText[hObject][uFormat];
Application->MessageBox ( strText.c_str(), strFormat.c_str(), MB_OK );
}