|
楼主 |
发表于 2024-8-11 09:31
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
自己出题自己做
- Sub ff()
- Dim Shp As Shape, ShpRng As ShapeRange, oShpRng As ShapeRange
- Dim Str
- Set ShpRng = Application.ActiveWindow.Selection.ShapeRange
- Dim Shps As Shapes
- Dim TxtRng As TextRange2
-
- For ii = 1 To ShpRng.Count
- Arr = msoShapeArr(ShpRng(ii))
- Str = Space(10) & "Arr(" & ii - 1 & ")=array("
-
- With ShpRng(ii)
- '.Name = .TextFrame2.TextRange.Text
- '.Name = "Txt1"
- Str = Str & """" & .Name & """," & Arr(1) & "," & .BackgroundStyle & "," & .Left & "," & .Top & "," & .Width & "," & .Height & ")"
- Debug.Print Str
- 'Debug.Print .TextFrame2.TextRange.Text, .Name, .Type, .AutoShapeType, .BackgroundStyle, .Left, .Top, .Width, .Height
-
- End With
-
-
-
- Next ii
- End Sub
- Sub ff1()
- Dim Arr(2)
- Dim ShpRng As ShapeRange
- Dim Sld As Slide, Slds As Slides
- Set Slds = Application.ActivePresentation.Slides
- For Each Sld In Slds
- ShpRngToPlace Sld
- Next Sld
- End Sub
- Function ShpRngToPlace(Sld As Slide)
- Dim Arr(2)
- Arr(0) = Array("Txt1", msoShapeRightArrow, 0, 1, 1, 410, 30)
- Arr(1) = Array("Txt2", msoShapeRectangle, 0, 435, 10, 200, 150)
- Arr(2) = Array("Txt3", msoShapePlaque, 0, 255, 485, 210, 50)
- Dim Shp As Shape, ShpRng As ShapeRange
- Set ShpRng = Sld.Shapes.Range(Array("Txt3", "Txt2", "Txt1"))
- ''
- For ii = 0 To UBound(Arr)
- With ShpRng(ii + 1)
- .AutoShapeType = Arr(ii)(1)
- .Left = Arr(ii)(3)
- .Top = Arr(ii)(4)
- .Width = Arr(ii)(5)
- .Height = Arr(ii)(6)
- End With
- Next ii
- End Function
复制代码 |
|