[英]Powerpoint - Save group as image via VBA
I would like to save a group as a png-Image.我想将一个组保存为 png-Image。
I am able to export an image as a complete slide, but I cannot figure out how to export only a particular group.我能够将图像导出为完整的幻灯片,但我无法弄清楚如何仅导出特定组。
This works for a slide:这适用于幻灯片:
Private Sub CommandButton1_Click()
neuerText = TextBox1.Value
ActivePresentation.Slides(1).Export "C:\bla\" & neuerText & ".png", "PNG"
End Sub
But how to select only a group?但是如何只选择一个组呢? Eg
例如
ActivePresentation.Slides(1).Shapes("Group 1").Export "C:\bla\" & neuerText & ".png", "PNG"
Ideally, the Image would have a transparent background.理想情况下,图像应具有透明背景。
Does anyone know how I can do this?有谁知道我怎么能做到这一点?
Using the ShapeRange
object should work.使用
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.