|
谢谢指点,反复学习你的程序。
到现在不会用Drawline,只会用Addline,AddPolyline
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape, Shps As Shapes
- Set Shps = Pres.Slides(2).Shapes
- Dim Arr(1), tmpArr
- Dim PlArr()
- ReDim PlArr(UBound(DrawlineArr) - 2)
- tmpArr = DrawlineArr
-
- Dim pointsArray(0 To 3) As Variant
- pointsArray(0) = Array(10, 10) '第一个顶点坐标
- pointsArray(1) = Array(52, 30) '第一个顶点坐标
- pointsArray(2) = Array(20, 40) '第二个顶点坐标
- pointsArray(3) = Array(15, 30) '第三个顶点坐标
- Shps.AddPolyline pointsArray
- For ii = Shps.Count To 1 Step -1
- Set Shp = Shps(ii)
- Shp.Delete
- Next ii
- Stop
- For ii = 0 To UBound(DrawlineArr) - 2
- Arr(0) = tmpArr(ii + 1)(0) + 100
- Arr(1) = tmpArr(ii + 1)(1) + 200
- PlArr(ii) = Arr
- Next ii
-
- Shps.AddPolyline PlArr
- Stop
-
-
- For i = 1 To UBound(Arr)
- For j = 0 To UBound(Arr(i))
- Shps.AddLine Arr(i)(j) + 100, i * 1 + 200, Arr(i)(j) + 100 + 0.5, i * 1 + 200 + 0.5
- Next
- Next
- Stop
-
- Stop
- End Sub
复制代码
|
|