我在word的宏里写了一段代码,执行后画了一条拐弯的线,可我不知道代码中的7个点是怎么控制线的,请大家帮忙,代码如下:
Dim pts(1 To 7, 1 To 2) As Single
pts(1, 1) = 0
pts(1, 2) = 0
pts(2, 1) = 0 
pts(2, 2) = 0 
pts(3, 1) = 100 
pts(3, 2) = 100 
pts(4, 1) = 0 
pts(4, 2) = 0 
pts(5, 1) = 90
pts(5, 2) = 120
pts(6, 1) = 60
pts(6, 2) = 30
pts(7, 1) = 150
pts(7, 2) = 90ActiveDocument.Shapes.AddCurve ptsEnd Sub

解决方案 »

  1.   

    Word帮助里讲的很清楚啊:expression.AddCurve(SafeArrayOfPoints, Anchor)
    expression    Required. An expression that returns a Shapes object.SafeArrayOfPoints   Required Variant. An array of coordinate pairs that specifies the vertices and control points of the curve. The first point you specify is the starting vertex, and the next two points are control points for the first Bézier segment. Then, for each additional segment of the curve, you specify a vertex and two control points. The last point you specify is the ending vertex for the curve. Note that you must always specify 3n + 1 points, where n is the number of segments in the curve.至于那个线(Bézier Curve)怎么画出来的,控制点怎么设,在网上找找就好了。比如我看了这个网页就有了个大致的概念:http://www.moshplant.com/direct-or/bezier/。 不过有问题别问我啊,我也是现炒现卖,:-)
      

  2.   

    tech兄,word里的帮助我是看过,可以由于偶的英文水平实在是!@$#&,所以就发个帖子来问问大家,呵呵,不过还是谢谢你,我去找人帮我把这段话翻译过来,大家有谁还用过的就给我点经验吧,省的偶看英文了,呵呵