若要创建 Application 对象事件的事件处理器,需要完成下列三个步骤: 在类模块中声明对应于事件的对象变量。
编写指定事件的过程。
从其他模块中初始化已声明的对象。
按照上面三个步骤后,为什么documentbeforeprint事件不响应.
类模块中:
Public WithEvents app As Word.Application
Private Sub app_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
UserForm1.Show 1
End Sub模块中:
Dim X As New 类1
Sub Register_Event_Handler()
Set X.App = Word.Application
End SubPrivate Sub Document_New()
register_event_handler
End Sub为什么打印时不弹出UserForm1窗体
编写指定事件的过程。
从其他模块中初始化已声明的对象。
按照上面三个步骤后,为什么documentbeforeprint事件不响应.
类模块中:
Public WithEvents app As Word.Application
Private Sub app_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
UserForm1.Show 1
End Sub模块中:
Dim X As New 类1
Sub Register_Event_Handler()
Set X.App = Word.Application
End SubPrivate Sub Document_New()
register_event_handler
End Sub为什么打印时不弹出UserForm1窗体
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货