兰州人 发表于 2007-8-23 16:16:00

[求助]AutoCAD实体,采用编程方法导入(插入)到Word?

本帖最后由 作者 于 2007-8-28 9:08:30 编辑 <br /><br /> <p>问题提出:</p><p>在AutoCAD中,选中实体+Ctrl+C,切换到Word界面,执行Ctrl+V,AutoCAD实体粘贴到Word中。在Word中双击AutoCAD实体图形,AutoCAD自动启动,在AutoCAD环境中可以修改AutoCAD图形。</p><p>请教各位大侠,实现这个思路的关键语句是什么?</p><p></p>

caiqs 发表于 2007-8-27 07:26:00

<p>1、在cad中调用sendcommand 发送copyclip命令</p><p>2、调用sendcommand 发送zoom o 命令</p><p>3、com方式调用word中的宏粘贴</p>

兰州人 发表于 2007-8-27 12:38:00

<p>谢谢楼上的给我提了个思路。在<a href="http://discussion.autodesk.com/thread.jspa?threadID=487522">http://discussion.autodesk.com/thread.jspa?threadID=487522</a></p><p>reply is </p><p>ThisDrawing.SendCommand "copyclip" &amp; vbCr &amp; "ALL" &amp; vbCrLf</p><p></p>

兰州人 发表于 2007-8-28 09:02:00

<p><a href="http://discussion.autodesk.com/thread.jspa?threadID=604446">http://discussion.autodesk.com/thread.jspa?threadID=604446</a>&nbsp;Reply is:</p><p><table cellspacing="0" cellpadding="0" width="698" border="0"><tbody><tr><td></td><td><b>Re: Copyclip AutoCad Entity Into Word?</b><br/>I hope the sample below does what you are asking.<br/><br/>Gary<br/><br/>Public Sub Run_This_Sub_From_Acad()<br/><br/>Dim oWord As Word.Application<br/><br/>'Before execution, set reference to MS Word Object Library<br/><br/>'The statement you mentioned<br/>ThisDrawing.SendCommand "copyclip" &amp; vbCr &amp; "ALL" &amp; vbCrLf<br/><br/>On Error Resume Next<br/>Set oWord = GetObject(, "Word.application")<br/><br/>If Err Then<br/>Set oWord = CreateObject("Word.application")<br/>oWord.Visible = True<br/>oWord.Documents.Add<br/>End If<br/><br/>On Error GoTo 0<br/><br/>oWord.Selection.Paste<br/><br/>End Sub </td><td></td></tr></tbody></table><br/><!--Element not supported - Type: 8 Name: #comment-->测试了一下,问题得到解决.谢谢 Gary McMaster 的解答.<br/></p>

sdaulj 发表于 2011-12-24 15:34:40

好帖子,关注中,有机会与楼主交流一下,QQ13940210
页: [1]
查看完整版本: [求助]AutoCAD实体,采用编程方法导入(插入)到Word?