谁用过ActiveDocument.Shapes.AddCurve,进来帮帮我

jam021 2004-07-20 11:23:40
我在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) = 90

ActiveDocument.Shapes.AddCurve pts

End Sub
...全文
367 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jam021 2004-07-26
  • 打赏
  • 举报
回复
自己顶一下
jam021 2004-07-20
  • 打赏
  • 举报
回复
tech兄,word里的帮助我是看过,可以由于偶的英文水平实在是!@$#&,所以就发个帖子来问问大家,呵呵,不过还是谢谢你,我去找人帮我把这段话翻译过来,大家有谁还用过的就给我点经验吧,省的偶看英文了,呵呵
sanyou98 2004-07-20
  • 打赏
  • 举报
回复
up
techgopher 2004-07-20
  • 打赏
  • 举报
回复
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,503

社区成员

发帖
与我相关
我的任务
社区描述
VBA(Visual Basic for Applications)是Visual Basic的一种宏语言,是在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。
社区管理员
  • VBA
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧