【问题标题】:how to multiple select programmatically in PowerPoint如何在 PowerPoint 中以编程方式进行多项选择
【发布时间】:2020-07-03 16:09:46
【问题描述】:

我想以编程方式从 PowerPoint 中特定幻灯片的一组形状中选择 2 个形状 A 和 B,然后执行“剪切”操作。我该怎么做?

注意:我使用的是 C#、Visual Studio 2013、PowerPoint 2013

【问题讨论】:

    标签: c# vsto powerpoint office-interop com-interop


    【解决方案1】:

    由于您还使用 PowerPoint-VBA 进行了标记,这就是我将在此处提供的示例。这将在当前演示文稿的第一张幻灯片上选择形状 1 和 3,然后剪切它们:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-17
      • 1970-01-01
      • 2020-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-23
      相关资源
      最近更新 更多