我想扩展 MS Outlook,以便当日历提醒弹出时,我可以运行一个可以运行外部程序(如批处理脚本)的 VBA 挂钩。就我而言,我想将提醒“转发”到 Linux 桌面,因为我在这两种环境中都工作,而且我并不总是让 Windows 桌面可见。
我在http://office.microsoft.com/en-us/outlook-help/HV080803406.aspx看到了一个示例,并在 MS Outlook 2010 中打开了 VBA 开发人员视图并插入了一个类模块并添加了该 VBA 代码,但我这样做了看不到如何激活此代码 - 弹出提醒时,此代码未激活。
更新
这是我最终添加到 Outlook 的 ThisOutlookSession 以在弹出提醒时运行外部批处理脚本的内容。
Public WithEvents objReminders As Outlook.Reminders
Private Sub Application_Startup()
Set objReminders = Application.Reminders
End Sub
Private Sub objReminders_ReminderFire(ByVal ReminderObject As Reminder)
Cmd = "C:\path\to\my\reminder-hook.cmd" & " " & ReminderObject.Caption
Call Shell(Cmd, vbHide)
End Sub