Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba 将每张幻灯片的形状/对象分组并在powerpoint presention中翻转_Vba_Powerpoint - Fatal编程技术网

Vba 将每张幻灯片的形状/对象分组并在powerpoint presention中翻转

Vba 将每张幻灯片的形状/对象分组并在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

我是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 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