icecools 发表于 2004-4-23 17:16:00

简单vba例子的问题!大家帮忙!

<FONT face=宋体 size=2>我照帮助上写个例子,是事件的,就是打印的时候msgbox文件名<BR>ThisDrawing代码:<BR>Dim X As New EventClassModule<BR>Call InitializeEvents<BR><BR>Sub InitializeEvents()<BR>Set X.Doc = ThisDrawing<BR>End Sub<BR><BR>EventClassModule代码:<BR>Public WithEvents Doc As AcadDocument<BR><BR>Private Sub Doc_BeginPlot(ByVal DrawingName As String)<BR>MsgBox (DrawingName)<BR>End Sub<BR>运行时出现Call那里是无效外部过程什么的<BR>其实我想加载了这个工程后打印的时候就可以起作用了,但现在要每次指定运行InitializeEvents以后打印才有效果,我应该怎么改啊?</FONT>

mccad 发表于 2004-4-24 07:07:00

在VBA中只需要这样:Private Sub AcadDocument_BeginPlot(ByVal DrawingName As String)
       MsgBox (DrawingName)
End Sub

icecools 发表于 2004-4-24 09:59:00

谢谢谢谢!
页: [1]
查看完整版本: 简单vba例子的问题!大家帮忙!