1

I want to programmatically select 2 shapes A and B from a set of shapes in a specific slide in PowerPoint, and then perform the "Cut" action. How can I do that?

Note: I am using C#, Visual Studio 2013, PowerPoint 2013

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
chipbk10
  • 5,783
  • 12
  • 49
  • 85

1 Answers1

2

Since you also tagged with PowerPoint-VBA, that's the example I'll provide here. This will select shapes 1 and 3 on the first slide of the active presentation then cut them:

Sub SelectShapes()

    With ActivePresentation.Slides(1)
        .Shapes(1).Select msoTrue  ' Start a new selection
        .Shapes(3).Select msoFalse ' Add to current selection
    End With

    ' and cut
    ActiveWindow.Selection.Cut

End Sub
Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34