Report.ObjectName
Returns/sets the name of the specified object in the report.
| Syntax | Parameters | Return/assignment value |
|---|---|---|
Property Report.ObjectName( _
index As Integer) As String
|
index [in]
Specifies the index of the embedded object. Type: Integer |
String |
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