Report.ObjectCount

Returns the number of embedded objects in the report.

This property is read only.

Syntax Parameters Return value
- - Integer

SVB Example

Adding a header, based on the name of the first item:

Option Base 1
Option Explicit
Sub Main
    Dim rpt As Report
    Set rpt = ActiveReport
    'if there are any embedded objects within the report
    'then retrieve the first one's name and set the title
    'the report to the name of the object
    If (rpt.ObjectCount) Then
        rpt.SetSelection(0,0)
        rpt.SelectionText = rpt.ObjectName(1) _
            & " Report" & vbCrLf & vbCrLf
    End If
End Sub