[R] RDCOMClient interface - problems setting a variable
mark.heckmann at gmx.de
Fri Aug 13 18:39:05 CEST 2010
I try to produce and modify shapes in a PowerPoint presentation but run into a difficulty setting a variable.
library(RDCOMClient) # load RDCOMClient package
library(SWinTypeLibs) # package SWinTypeLibs from Omegahat to access information about COM libraries
ppt = COMCreate("PowerPoint.Application") # create a ppt COM
ppt[["Visible"]] <- TRUE # set COM property visible to TRUE
pres = ppt$Presentations()$Add() # add a presentation
slide <- pres$Slides()$Add(1,1) # add slide to presentation
shape1 <- slide$Shapes()$AddShape(92, 200, 200, 100, 100) # add a shape object
shape1$Adjustments()$Item(1) # read adjustment parameter
How can I change this setting now? Taking a look at the functions available it shows that there are two item() functions - a getter and a setter, but have the same name.
str(getFuncs(shape1$Adjustments())[]) # getter
str(getFuncs(shape1$Adjustments())[]) # setter
In VBA it works like this, supposing the shape is selected:
ActiveWindow.Selection.ShapeRange.Adjustments.Item(1) = 2
Here getting and setting is done by appointing a value or not.
I have no clue how to use the setter via R. Can anyone help?
A lot of thanks in advance!!
Dipl. Wirt.-Ing. cand. Psych.
Vorstraße 93 B01
More information about the R-help