I just tried to do the same task (see beloew) using the rcom package. This 
works fine (see below).
Still I would like to now how this can be done using RDCOMClient.

TIA, Mark

library(rcom)
ppt <- comCreateObject("PowerPoint.Application")
pres <- comInvoke(comGetProperty(ppt, "Presentations"), "Add")
ppt <- comSetProperty(ppt, "Visible", TRUE)

slide <- comInvoke(comGetProperty(pres, "Slides"), "Add", 
                                   comGetProperty(comGetProperty(pres, 
"Slides"), "Count") + 1, 12)
                                
allShapes <- comGetProperty(slide, "Shapes")
shape1 <- comInvoke(allShapes, "AddShape", 92, 200, 200, 100, 100)

adj <- comGetProperty(shape1, "Adjustments")
comGetProperty(adj, "Item", 1)
comSetProperty(adj,"Item", 1,.1)



Am 13.08.2010 um 19:37 schrieb Mark Heckmann:

> 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.
> 
> names(getFuncs(shape1$Adjustments()))
> str(getFuncs(shape1$Adjustments())[[12]])             # getter
> str(getFuncs(shape1$Adjustments())[[13]])             # 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!!
> 
> Mark
> –––––––––––––––––––––––––––––––––––––––
> Mark Heckmann
> Dipl. Wirt.-Ing. cand. Psych.
> Vorstraße 93 B01
> 28359 Bremen
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
> 
> 
> 
> 

–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Dipl. Wirt.-Ing. cand. Psych.
Vorstraße 93 B01
28359 Bremen
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com





        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to