在每张幻灯片上,我想选择所有形状,然后将其分组并保存为 SVG 文件,然后转到下一张幻灯片直到最后一张幻灯片。到目前为止,这是我所拥有的,但它无法正常运行。任何建议将不胜感激。
这是我到目前为止的代码
Sub GroupandsaveSVG()
Dim folderPath As String
Dim sld As Slide
Dim shp As Shape
folderPath = Environ("USERPROFILE") & "\Desktop\mySVGs\"
On Error Resume Next
MkDir folderPath
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes.SelectAll
Selection.Group
Call .Export(folderPath & "Shape" & CStr(x) & ".svg", ppShapeFormatSVG)
Next
Next
End Sub
谢谢你
Shapes.Range.Group
Shapes.Range.Export
Option Explicit
Sub GroupSaveSVG()
Dim folderPath As String
Dim Sld As Slide
Dim Shp As Shape
Dim i As Integer
folderPath = Environ("USERPROFILE") & "\Desktop\mySVGs\"
On Error Resume Next
MkDir folderPath
On Error GoTo 0
For Each Sld In ActivePresentation.Slides
If Sld.Shapes.Range.Count >= 2 Then
Sld.Shapes.Range.Group
End If
Sld.Shapes.Range.Export folderPath & "Shape" & CStr(i + 1) & ".svg", ppShapeFormatSVG
i = i + 1
Next
End Sub