|
楼主 |
发表于 2023-12-20 14:22
|
显示全部楼层
学习学习再学习
- Sub CopyPasteShp()
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape, Shp1 As Shape
- Dim ShpRng As ShapeRange, tArr(3)
- Dim ii, Cc As Integer
- Set Sld = Pres.Slides(3)
- For Each Shp In Sld.Shapes
- Debug.Print Shp.Name, Shp.AutoShapeType
-
- If Shp.AutoShapeType >= 45 And Shp.AutoShapeType <= 48 Then
- tArr(Cc) = Shp.Name
- Cc = Cc + 1
- End If
- Next Shp
- Set ShpRng = Sld.Shapes.Range(tArr)
- Debug.Print ShpRng.Count
- For ii = 4 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
- Sld.Select
- ShpRng.Copy
- Sld.Shapes.Paste
-
- Next ii
- End Sub
- ''
- Sub CShp()
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape, Shp1 As Shape
- Dim ShpRng As ShapeRange, tArr(3)
- Dim ii, Cc As Integer
- Set Sld = Pres.Slides(3)
- For Each Sld In Pres.Slides
- For Each Shp In Sld.Shapes
- 'Debug.Print Shp.Name, Shp.AutoShapeType
- If Shp.AutoShapeType >= 45 And Shp.AutoShapeType <= 48 Then
- Shp.Fill.Transparency = 1
- Shp.Fill.ForeColor.RGB = 0
- Cc = Cc + 1
- End If
- Next Shp
- Next Sld
- 'Set ShpRng = Sld.Shapes.Range(tArr)
- End Sub
复制代码
|
|