作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 try catch 日历约会对象上的 appt_Write 事件。下面的代码适用于所有情况,除非用户选择约会并单击一次拖动它。
有没有更好的方法来设置 appt 对象,以便我可以为任何日历上的任何约会捕获 appt_Write 事件?
Private WithEvents objExplorer As Outlook.Explorer
Private WithEvents appt As Outlook.AppointmentItem
Public Sub Application_Startup()
Set objExplorer = Application.ActiveExplorer
End Sub
Private Sub objExplorer_SelectionChange()
If objExplorer.CurrentFolder.DefaultItemType = olAppointmentItem Then
If objExplorer.Selection.Count > 0 Then
Set appt = objExplorer.Selection(1)
End If
End If
End Sub
Private Sub appt_Write(Cancel As Boolean)
'Do something with Appt Object here. When a user clicks and drags,
'this write event has already fired by the time the Appt object is set.
End If
End Sub
最佳答案
您可以尝试在文件夹上使用 Items.ItemChange 事件,但它只会在项目更改后触发。
关于vba - 如何在VBA中同时单击和拖动约会对象时捕获Appt_Write事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14172866/
我是一名优秀的程序员,十分优秀!