Vba 将每张幻灯片的形状/对象分组并在powerpoint presention中翻转
我是power point VBA新手,我想将每个power point幻灯片中的所有形状/对象分组,并将其水平翻转在所有演示幻灯片中将字体更改为arial 这是我得到的代码,但它将每个形状单独分组,我不能在翻转之前添加分组,请告知 子DTPMacroVba 将每张幻灯片的形状/对象分组并在powerpoint presention中翻转,vba,powerpoint,Vba,Powerpoint,我是power point VBA新手,我想将每个power point幻灯片中的所有形状/对象分组,并将其水平翻转在所有演示幻灯片中将字体更改为arial 这是我得到的代码,但它将每个形状单独分组,我不能在翻转之前添加分组,请告知 子DTPMacro Dim sld As Slide Dim shp As Shape Dim sFontName As String ' Edit this as needed: sFontName = "Arial" With Activ
Dim sld As Slide
Dim shp As Shape
Dim sFontName As String
' Edit this as needed:
sFontName = "Arial"
With ActivePresentation
For Each sld In .Slides
For Each shp In sld.Shapes
shp.Flip msoFlipHorizontal
With shp
If .HasTextFrame Then
If .TextFrame.HasText Then
.TextFrame.TextRange.Font.Name = sFontName
End If
End If
End With
Next
Next
End With
End Sub
请尝试以下方法:
Sub DTPMacro()
Dim sld As Slide
Dim shp As Shape
Dim grpshp As Shape
Dim sFontName As String
' Edit this as needed:
sFontName = "Arial"
With ActivePresentation
For Each sld In .Slides
For Each shp In sld.Shapes
' Don't flip the individual shapes
'shp.Flip msoFlipHorizontal
With shp
If .HasTextFrame Then
If .TextFrame.HasText Then
.TextFrame.TextRange.Font.Name = sFontName
End If
End If
End With
Next
' group and flip the shapes on the slide here
Set grpshp = sld.Shapes.Range.Group
grpshp.Flip msoFlipHorizontal
Next
End With
End Sub