我刚开始使用 Windows 7,我想知道如何让 Outlook 提醒弹出并突出显示。它们会一直悄悄打开,就像任务栏上 Outlook 堆栈中的另一个窗口一样。因此,我总是忽略它们,因为它们弹出在其他所有窗口后面。
我怎样才能让它们不那么容易被忽视?
(显然,人们通常不希望令人讨厌的应用程序将自己推到最前面。但有些地方是希望出现这种行为的,Outlook 日历提醒就是其中之一。)
答案1
我在使用 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
对宏进行签名以便其运行:工具>数字签名...并选择您之前创建的证书
- 关闭 VBA 窗口
- 在文件 > 选项 > 信任中心 > 信任中心设置 > 宏设置中启用所有宏
答案2
也可以使用 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
}
答案3
我找到的最佳答案在这里:如何使用一些简单的 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
对宏进行签名,以便它可以运行,方法是转到“工具”>“数字签名...”,然后选择您之前创建的证书
- 关闭 VBA 窗口
答案4
与上面 Gullu 的回答相同,但有所改变以适应不同的窗口标题:
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