是否可以在 Outlook 启动时运行 VBA 函数?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1565231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 10:53:06  来源:igfitidea点击:

Is it possible to run a VBA function whenever Outlook starts up?

vbaoutlookstartup

提问by Richard

I would like to have a VBA function run as soon as Outlook starts up. Is this possible and if so, what do I need to do? My searches on Google have failed me.

我想在 Outlook 启动后立即运行 VBA 函数。这可能吗,如果可以,我需要做什么?我在 Google 上的搜索失败了。

I don't mind that the security alert will pop up.

我不介意弹出安全警报。

回答by Alistair Knock

Use the Application_Startupevent in ThisOutlookSession:

在 中使用该Application_Startup事件ThisOutlookSession

Private Sub Application_Startup()
    MsgBox "Foo"
End Sub

回答by Galwegian

Have you looked at the Application_Startup()event?

你看过Application_Startup()事件吗?