API Documentation > CorelDRAW > 2025-v26 > DataItems > IVGDataItems
DataItems.Count property
Gets the number of items in the collection of data items
Syntax:
Property Get Count() As Long
Remarks:
The Count property returns the number of fields available. Empty, non-document-default fields are not listed in this collection. See DataFields for the full list of data fields available in the document.
Examples:
The following VBA example counts the number of data fields in the active shape.
Sub Test()
Dim n As Long
CountFields = ActiveSelection.Shapes(1).ObjectData.Count
MsgBox CountFields 
End Sub