使用Outlook 365。
我需要代码把Outlook提醒带到所有其他窗口的前面。我在Extend网站上找到了这段代码,并将其输入到ThisOutlookSession模块中:
Private Sub Application_Reminder(ByVal Item As Object)
'Updated by ExtendOffice 20180814
Dim xAppointment As AppointmentItem
If Item.Class = olAppointment Then
Set xAppointment = Item
MsgBox xAppointment.Subject, 4096 + vbInformation + vbOKOnly, "Outlook reminders"
End If
End Sub上周,它运行得很好;每当有人发出提醒时,我都会看到一个Msgbox重复它的消息。
这周,我意识到Msgbox不再出现了。我相信我的电脑在周末重新启动了,但这是我唯一能想到的改变。我尝试过用断点来捕获代码,而且据我所知,它只是没有运行。
我不熟悉"ThisOutlookSession",但为了安全起见,我试着重新启动Outlook,但没有帮助。我在Windows中使用了两台不同的桌面,我试着在每个桌面上运行Outlook,但这似乎并不重要。
发布于 2022-11-10 23:49:10
首先,您需要检查Outlook中的信任中心设置是否允许运行VBA宏。然后尝试通过以下方法在Outlook中启用宏:
"File"->"Options"->"Trust Center"->"Trust Center Settings..."->"Macro Settings"->"Enable all macros"您可能会在重新启动后Outlook不运行Visual和VB宏一开始运行成功,但在Outlook重新启动后失败文章中发现类似的问题。
https://stackoverflow.com/questions/74395415
复制相似问题