ObjectGetProperty function

Syntax

ObjectGetProperty(obj_this, str_property_name [, index_param_list])

Description

Use the ObjectGetProperty function to return the value of a property str_property_name of the object obj_this.

Note:

The object must have already been instantiated, either using CreateObject or another function or method that returns an object. Default" OLE Automation object properties are not supported. You must specify the object property that you want to retrieve explicitly.

Parameters

Parameter Description

obj_this

Specify an already instantiated object. This variable must have been instantiated either with CreateObject or another function or method that creates objects.

str_property_name

A string containing the name of an exposed property of obj_this.

index_param_list

A comma-separated list for accessing an OLE automation object indexed property. (These parameters are only used with OLE/COM objects.)

Returns

Returns an Any value equal to the value of the str_property_name property of the obj_this object.

Example

This simple example instantiates an Excel worksheet object, makes it visible, names it, saves it, and displays its name.

&WORKAPP = CreateObject("Excel.Application"); 
&WORKBOOKS = ObjectGetProperty(&WORKAPP, "Workbooks"); 
ObjectDoMethod(&WORKBOOKS, "Add", "C:\TEMP\INVOICE.XLT"); /* This associates the⇒
 INVOICE template w/the workbook */ 
ObjectDoMethod(&WORKAPP, "Save", "C:\TEMP\TEST1.XLS"); 
ObjectSetProperty(&WORKAPP, "Visible", True);

Excel Worksheets had an index property called Range that has the following signature:

Property Range (Cell1 [, Cell2]) as Range

In the following example, the range is A1:

&CELL = ObjectGetProperty(&SHEET, "Range", "A1");