This may seem trivial but I haven't been able to find a way. How do PowerPoint Object Model allow you to add a Shape
object to a slide's Shapes
collection? I can add new shapes using functions like Shapes.AddSmartArt()
, Shapes.AddPicture()
etc, but those will add new shapes. What if I have an existing Shape object's reference that I want to add to slide's shapes?
One way of doing it is to call Copy()
on the shape object and then call Paste()
in the target slide, but I find it less than ideal since we'll modify the clipboard in the process (I know we can restore it after the operation, but then again this is lame).
There are no Add()
, Append()
or Insert()
functions in the Shapes
collection as far as I have searched.
Edit
Perhaps I didn't make it clear enough. Let me try again. Say I have a Shape object in a variable like this (PowerPoint/VSTO/C#):
Shape s = GetShape(); //This function returns a Shape object
MyPresentation.Slides[1].Shapes.???(s);
I need a suitable function in place of ???
; something like Add
, Insert
, Append
etc, but nothing like this exists in the Object Model.