xtatjh 发表于 2007-7-11 15:51:00

[求助]:VBA小问题,请高手赐教

<p>比如:我现在有一条插入文本命令:Set WordObj = ThisDrawing.ModelSpace.AddText(strV, startPnt, width)</p><p>当插入一行文本后就结束了,要再点菜单才再插入第二条:</p><p>我怎么让用户可以重复插入此文本,直到ESC取消啊!</p>

lafare 发表于 2007-7-12 11:46:00

本帖最后由 作者 于 2007-7-12 11:48:42 编辑 <br /><br /> <p>Sub ProgramTest()</p><p>&nbsp;&nbsp;&nbsp; Dim varPoint As Variant<br/>&nbsp;&nbsp;&nbsp; Dim objWord As AcadText<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; On Error GoTo DoError<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Do<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varPoint = ThisDrawing.Utility.GetPoint(, "请指定一个坐标点(按ESC退出):")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objWord = ThisDrawing.ModelSpace.AddText("一个测试字符串", varPoint, 200)<br/>&nbsp;&nbsp;&nbsp; Loop<br/>&nbsp;&nbsp;&nbsp; <br/>DoError:<br/>&nbsp;&nbsp;&nbsp; MsgBox "您已经按ESC退出了。"</p><p>End Sub</p>

xtatjh 发表于 2007-7-13 11:55:00

<p><strong><font face="Verdana" color="#61b713">lafare:</font></strong></p><p><strong><font face="Verdana" color="#61b713">&nbsp;&nbsp; 谢谢!测试通过</font></strong></p>
页: [1]
查看完整版本: [求助]:VBA小问题,请高手赐教