PPT里对指定三角形的三条边作垂直平分线的VBA代码
时间: 2023-02-28 12:31:58 浏览: 201
可以使用以下VBA代码:Sub SplitTriangle() Dim myTriangle As Shape, myLine As Shape Dim myPoint1 As Point, myPoint2 As Point, myPoint3 As Point 'Get the triangle to be split Set myTriangle = ActiveSheet.Shapes(1) 'Get the coordinates of the triangle points myPoint1.X = myTriangle.Left myPoint1.Y = myTriangle.Top myPoint2.X = myTriangle.Left + myTriangle.Width myPoint2.Y = myTriangle.Top myPoint3.X = myTriangle.Left myPoint3.Y = myTriangle.Top + myTriangle.Height 'Draw the two lines Set myLine = ActiveSheet.Shapes.AddLine(myPoint1.X, myPoint1.Y, myPoint2.X, myPoint2.Y) myLine.Line.Weight = 2 Set myLine = ActiveSheet.Shapes.AddLine(myPoint2.X, myPoint2.Y, myPoint3.X, myPoint3.Y) myLine.Line.Weight = 2 End Sub
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![ppt](https://img-home.csdnimg.cn/images/20241231044937.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![ppt](https://img-home.csdnimg.cn/images/20241231044937.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![ppt](https://img-home.csdnimg.cn/images/20241231044937.png)