ITabObjects.SelectedObject

Syntax

SelectedObject(Index: Integer): ITabObject;

Parameters

Index is the index of selected object.

Description

The SelectedObject property returns the selected object, the index of which is passed as the Index input parameter.

Example

Sub Macro;

Var

Rep: IPrxReport;

Objs: ITabObjects;

Obj: ITabObject;

i: Integer;

Begin

Rep := PrxReport.ActiveReport;

Objs := Rep.ActiveSheet.Table.Objects;

Objs.CenterSelectedAtView;

If Objs.Count <> 0 Then

For i := 0 To Objs.Count - 1 Do

Objs.Item(i).Select_;

End For;

Obj := Objs.SelectedObject(Objs.SelectedCount - 1);

Rep.ActiveSheet.Table.Cell(10, 0).Value := Obj.ClassId;

End If;

End Sub Macro;

This example is a macro for a regular report. After this macro has been executed, all the objects of the active sheet of the regular report will be selected, then the cell "A10" will contain the class identifier of the last selected object.

See also:

ITabObjects