chipbk10
chipbk10

Reputation: 5955

how to multiple select programmatically in PowerPoint

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

Upvotes: 1

Views: 1142

Answers (1)

Steve Rindsberg
Steve Rindsberg

Reputation: 14810

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

Upvotes: 2

Related Questions