Powerpoint - 通过 VBA 将群组另存为图片

Powerpoint - Save group as image via VBA

我想将组保存为 png 图像。

我可以将图像导出为完整的幻灯片,但我不知道如何只导出特定组。

这适用于幻灯片:

Private Sub CommandButton1_Click()
    neuerText = TextBox1.Value
    ActivePresentation.Slides(1).Export "C:\bla\" & neuerText & ".png", "PNG"
End Sub

但是如何select只一组呢?例如

ActivePresentation.Slides(1).Shapes("Group 1").Export "C:\bla\" & neuerText & ".png", "PNG"

理想情况下,图像应具有透明背景。

有人知道我该怎么做吗?

使用 ShapeRange 对象应该可行。

Private Sub CommandButton1_Click()
    neuerText = TextBox1.Value

    Dim myGroup As ShapeRange
    Set myGroup = ActivePresentation.Slides(1).Shapes.Range("Group 1")
    myGroup.Export "C:\bla\" & neuerText & ".png", ppShapeFormatPNG
End Sub