GetNumDocAnnotations method
The number of annotations attached to the document is returned in the specified variable.
- Method
- short GetNumDocAnnotations(
- Parameters
- pNumAnnotations
Points to a variable to receive the number of annotations attached to the document. On return, this variable is set to type VT_I4.
- Description
- The number of annotations attached to the document is returned in the specified variable.
- Return Value
- Refer to return codes.
- See Also
- GetNumDocAnnotations and GetAnnotationForDoc methods
C/C + +
The following example retrieves the annotations for a document. VARIANT num_notes, page, ispublic, canbecopied;
CArsOle * pArsCtrl;
short rc, j;
char * pText, userid[100], datetime[200];
rc = pArsCtrl->GetNumDocAnnotations( &num_notes );
if ( rc != ARS_OLE_RC_SUCCESS )
ERROR;
pText = new char[35000];
for ( j = 0; j < num_notes.iVal; j++ )
{
rc = pArsCtrl->GetDocAnnotation( j,
(LPUNKNOWN)pText,
(LPUNKNOWN)userid,
(LPUNKNOWN)datetime,
&page,
&ispublic,
&canbecopied );
if ( rc != ARS_OLE_RC_SUCCESS )
ERROR;
// Process annotation
}
delete pText;
Visual Basic
Dim rc, j As Integer
Dim num_notes, page, ispublic, canbecopied As Variant
Dim text As String
Dim userid As String
Dim datetime As String
rc = ArsOle.GetNumDocAnnotations( num_notes );
if rc <> ARS_OLE_RC_SUCCESS Then
MsgBox "ERROR"
End
End If
For j = 0 To num_notes -1
rc = ArsOle.GetAnnotationForDoc( j, _
text, _
userid, _
datetime, _
page, _
ispublic, _
canbecopied )
if rc <> ARS_OLE_RC_SUCCESS Then
MsgBox "ERROR"
End
End If
' Process Annotation
Next j