【问题标题】:How to add MS outlook reminders event handlers with VBA如何使用 VBA 添加 MS Outlook 提醒事件处理程序
【发布时间】:2011-08-14 01:42:24
【问题描述】:

我想扩展 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

【问题讨论】:

    标签: vba outlook hook reminders


    【解决方案1】:

    将其放入“ThisOutlookSession”模块并重启Outlook。

    此外,请确保在 Outlook 设置中启用了宏。

    【讨论】:

    • 为我工作。请注意,还必须在 Outlook 中启用宏;这是一个不同的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-24
    • 2014-02-07
    • 1970-01-01
    • 2018-05-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多