如何使 Outlook 日历提醒在 Windows 7 中保持在最前面

thu*_*eek 127 windows microsoft-outlook calendar popups reminder

我刚刚开始使用 Windows 7,我想知道如何让我的 Outlook 提醒弹出并突出显示。它们一直小心翼翼地打开,就像任务栏上 Outlook 堆栈中的另一个窗口一样。结果,我一直忽视它们,因为它们突然出现在其他一切之后。

我如何让它们更不容易被忽视?

(显然,人们通常不希望将自己推到最前面的令人讨厌的应用程序。但有一些地方需要这种行为,Outlook 日历提醒就是其中之一。)

Gul*_*llu 63

我在 Outlook 2010 中遇到了同样的问题。使用下面提到的步骤,它就像一个魅力。不要忘记启用所有宏:信任中心 > 宏设置。

  • 为以后创建数字证书:点击开始并输入“证书”,选择“VBA 项目的数字证书”
  • 输入证书的名称。单击确定。打开 Outlook 并点击Alt+F11以启动 VBA 编辑器。
  • 在左侧的树中,展开“Microsoft Office Outlook 对象”并双击“ThisOutlookSession”
  • 粘贴此代码:

    Private Declare PtrSafe Function FindWindowA Lib "user32" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    Private Declare PtrSafe Function SetWindowPos Lib "user32" ( _
    ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
    ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _
    ByVal cy As Long, ByVal wFlags As Long) As Long
    
    Private Const SWP_NOSIZE = &H1
    Private Const SWP_NOMOVE = &H2
    Private Const FLAGS As Long = SWP_NOMOVE Or SWP_NOSIZE
    Private Const HWND_TOPMOST = -1
    
    Private Sub Application_Reminder(ByVal Item As Object)
    Dim ReminderWindowHWnd As Variant
    On Error Resume Next
    ReminderWindowHWnd = FindWindowA(vbNullString, "1 Reminder")
    SetWindowPos ReminderWindowHWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
    
    End Sub
    
    Run Code Online (Sandbox Code Playgroud)
  • 对宏进行签名以使其运行:工具 > 数字签名...并选择您之前创建的证书

  • 关闭 VBA 窗口
  • 在文件 > 选项 > 信任中心 > 信任中心设置 > 宏设置中启用所有宏

  • 我注意到,有时(通常在您启动 Outlook 时)第一个提醒不会停留在最前面。单击“关闭”并关闭提醒后,所有后续提醒都会保留在顶部。不知道为什么。 (3认同)
  • `On Error Resume Next` 仅适用于该 Sub 并防止整个宏崩溃。这只是标准的 VBA 用法。 (3认同)
  • 我遇到了与 Gullu 在他的第一条评论中指出的相同的问题。为了解决这个问题,我在重新启动 Outlook(或我的计算机)后显示了第一个提醒的消息框。`Private messageAlreadyShown As Boolean `Private Sub Application_Reminder(ByVal Item As Object) `On Error Resume Next `If Not messageAlreadyShown Then `MsgBox "First Reminder", vbSystemModal, "" `End If `messageAlreadyShown = True `ReminderWindow = FindWindowA(vbNullString) "1 Reminder") `SetWindowPos ReminderWindow, HWND_TOPMOST, 0, 0, 0, 0, FLAGS `End Sub (3认同)
  • 我找不到为宏创建自签名证书的工具。我在 C:\Program Files\Microsoft Office\OfficeXX 中找到了它,该工具是 SELFCERT.EXE。 (3认同)
  • 我改变了我的找到“1个提醒”然后它起作用了。 (3认同)

Eri*_*c L 21

AutoHotKey 也可以用来解决这个问题。此脚本会将提醒窗口置于顶部而不窃取焦点(使用 Win10 / Outlook 2013 测试)

TrayTip Script, Looking for Reminder window to put on top, , 16
SetTitleMatchMode  2 ; windows contains
loop {
  WinWait, Reminder(s), 
  WinSet, AlwaysOnTop, on, Reminder(s)
  WinRestore, Reminder(s)
  TrayTip Outlook Reminder, You have an outlook reminder open, , 16
  WinWaitClose, Reminder(s), ,30
}
Run Code Online (Sandbox Code Playgroud)

AHK 脚本-编译的 EXE


小智 13

我找到的最佳答案在这里:如何使用一些简单的 VBA 让 Outlook 约会提醒再次在其他窗口前弹出。

它需要向“ThisOutlookSession”添加几行简单的 VBA 代码。现在,它每次都会弹出一个窗口。好多了。

  • 为以后创建数字证书
  • 点击开始并输入“证书”,选择“VBA 项目的数字证书”
  • 输入证书的名称
  • 完毕
  • 打开 Outlook 并按 Alt + F11 以启动 VBA 编辑器。
  • 在左侧的树中,展开“Microsoft Office Outlook 对象”并双击“ThisOutlookSession”
  • 粘贴此代码,修改引号中的文本以适合您的喜好。留下引号。

    Private Sub Application_Reminder(ByVal Item As Object)
    
    
        If TypeOf Item Is AppointmentItem Then
        MsgBox "Message text", vbSystemModal, "Message title"
        End If
    
    
    End Sub
    
    Run Code Online (Sandbox Code Playgroud)
  • 对宏进行签名,以便它可以通过转到工具 > 数字签名...并选择您之前创建的证书来运行

  • 关闭 VBA 窗口


Bri*_*an 6

不可能。我们公司尝试直接上报给微软。人们在这里做的一件事是为其分配更令人讨厌的声音,以帮助注意它。但微软告诉我们这是设计使然。

  • 我在一个立方体农场工作——我试着让我的电脑安静下来,让别人看。:( (11认同)
  • 如果他们真的在设计,他们会默认采用这种方式,但允许对其进行更改。他们“设计”,我们学会忍受了吗? (3认同)

tbo*_*one 6

与上面 Gullu 的 anwer 相同,但进行了更改以适应不同的窗口标题:

Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare PtrSafe Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const FLAGS As Long = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1

'// TO ACCOUNT FOR WINDOW TITLE CHANGING WITH NOTIFICATION COUNT:
Private Sub Application_Reminder(ByVal Item As Object)
    Dim ReminderWindowHWnd As Variant
    'On Error Resume Next
    On Error GoTo err
    'Loop 25 times as FindWindowA needs exact title which varies according to number of reminder items...
    Dim iReminderCount As Integer
    For iReminderCount = 1 To 25
        'Try two syntaxes...
        ReminderWindowHWnd = FindWindowA(vbNullString, iReminderCount & " Reminder"): SetWindowPos ReminderWindowHWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
        ReminderWindowHWnd = FindWindowA(vbNullString, iReminderCount & " Reminder(s)"): SetWindowPos ReminderWindowHWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
    Next
Exit Sub
err:
    Debug.Print err.Number & " - " & err.Description & " (iReminderCount = " & iReminderCount & ")"
    Resume Next
End Sub
Run Code Online (Sandbox Code Playgroud)


JOA*_*MON 6

自 1803 版(2018 年 2 月)起,“在其他窗口之上显示提醒”选项现已可用。默认情况下它似乎没有启用。

在此处输入图片说明

  • 我还没有更新版本,但这很棒!而且我问了也只有 7 年了。(这是对 MS 的不满,也是对你的感谢。) (3认同)
  • 这是对旧问题的极好更新。请注意,这与“始终在顶部”并不完全相同,但它确实确保窗口确实在 z 顺序的顶部弹出,因此用户不太可能错过它。 (2认同)