求指正下面程序的错误?
我想当打开cad文件时,自动加载命令,但下面的程序只能在打开第一个文件时加载vba宏,怎样才能每次打开文件时都能加载呢?<br/>Public TestLoad As Boolean<br/>Private Sub AcadDocument_EndCommand(ByVal CommandName As String)<br/> If Not TestLoad Then<br/> ThisDrawing.SendCommand "(defun c:bz()(vl-vbarun ""bz"")(princ))(princ)" & vbCr<br/> ThisDrawing.SendCommand "(defun c:rz()(vl-vbarun ""rz"")(princ))(princ)" & vbCr<br/> TestLoad = True<br/> End If<br/>End Sub<br/><br/> <p>If Not TestLoad Then<br/> ThisDrawing.SendCommand "(defun c:bz()(vl-vbarun ""bz"")(princ))(princ)" & vbCr<br/> ThisDrawing.SendCommand "(defun c:rz()(vl-vbarun ""rz"")(princ))(princ)" & vbCr<br/> TestLoad = True</p><p>else</p><p> ThisDrawing.SendCommand "bz" & vbCr<br/> ThisDrawing.SendCommand "rz" & vbCr<br/><br/> End If<br/></p>
页:
[1]