[[.COMObject {rcom}R Documentation

Read or Write One of a COM Object's Properties

Description

Reads or writes one of the COM object's properties.

Usage

handle[[property,...]]
handle[[property,...]] <- value

Arguments

handle COM object (class "COMObject") as returned by e.g. comCreateObject
property name of property to get as a character string
... optional additional arguments for property specification (e.g. index for an array)
value the value the property should be set to

Value

When reading a property, the return value depends on the (data) type of the property to read. When writing, the return value is the object handle.

Author(s)

Gabor Grothendieck

See Also

comGetProperty, $.COMObject

Examples

# start up excel
## Not run: x<-comCreateObject("Excel.Application")

# retrieve the "Visible" property
## Not run: v <- x[["Visible"]]

# and make it visible
## Not run: x[["Visible"]] <- TRUE;

# add a new workbook to Excel and gain access to the first worksheet
## Not run: newwb <- x[["Workbooks"]]$Add()
## Not run: ws <- newwb[["Worksheets",1]]

# get a specific range
## Not run: r <- ws[["Range","A1","B4"]]

# set the value of index 3 of the indexed property ArrayProperty
## Not run: x[["ArrayProperty",3]] <- TRUE;

[Package rcom version 1.5-1 Index]