Outlook Calendar notification doesn't show up on top of other windows

4

1

I'm using Outlook 2007 on 64-bit Vista Business, and I've been having problems with Outlook Calendar notifications showing up behind other windows. This leaves my only clue that I should be at a meeting that there's a blue entry on the task bar. I haven't found a setting that relates to that.

Has anybody else had this problem? Does anybody know how to get notification windows on top of other windows consistently?

David Thornley

Posted 2009-09-29T17:05:13.633

Reputation: 701

Man, I wish I could induce that behaviour from Outlook. :( – JMD – 2009-09-29T17:09:15.230

@JMD: Much as I hate windows stealing focus, I've been late for the past two Tuesday morning meetings. – David Thornley – 2009-09-29T17:16:21.503

Answers

1

This free add-in might help force the reminder window to pop-up like you want it to: http://blogs.kraftkennedy.com/index.php/2010/06/07/getting-outlook-meeting-reminders-in-focus-over-other-applications/

AdamV

Posted 2009-09-29T17:05:13.633

Reputation: 5 011

0

If you want an in Outlook answer then this post has most of the answer. However it didn't work for me as the reminder window is not visible until the Application_Reminder subroutine has finished, which means FindWindowA can't find the reminder window.

If you've got the same issue I hacked a solution by using SetTimer. I'll re-post the steps in full although the top and tail is just a repeat from the other post.

  • Create a Digital certificate for later. Hit Start and type 'certificate', select 'Digital Certificate for VBA Projects'
  • Enter a name for your certificate then press Done
  • Open Outlook and hit ALT + F11 to start the VBA editor.
  • In the tree on the left, expand 'Microsoft Office Outlook Objects' and double click on 'ThisOutlookSession'
  • Paste the following code in:

Option Explicit

Private Sub Application_Quit()

    ' Turn off timer upon quitting VERY IMPORTANT
    Call DeactivateTimer

End Sub

Private Sub Application_Reminder(ByVal Item As Object)

    ' Call helper function in 1 second as reminder window not yet visible
    If TypeOf Item Is AppointmentItem Then ActivateTimer (1)

End Sub

  • Add a new module by right clicking on 'ThisOutlookSession' and then selecting Insert > Module
  • In the new module (which you should have switched to) paste the following code:

Option Explicit

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 Declare PtrSafe Function SetTimer Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal nIDEvent As Long, _
    ByVal uElapse As Long, _
    ByVal lpTimerfunc As Long) As Long

Private Declare PtrSafe Function KillTimer Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal nIDEvent 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 TimerID As Long 'Need a timer ID to eventually turn off the timer. If the timer ID is not 0 then the timer is running

Public Sub ActivateTimer(ByVal nSeconds As Long)

    'The SetTimer call accepts milliseconds, so convert to seconds
    nSeconds = nSeconds * 1000

    ' Check to see if timer is running before call to SetTimer
    If TimerID <> 0 Then Call DeactivateTimer

    TimerID = SetTimer(0, 0, nSeconds, AddressOf Reminder_Helper)

    If TimerID = 0 Then MsgBox "The timer failed to activate."

End Sub

Public Sub DeactivateTimer()

Dim lSuccess As Long

    If TimerID <> 0 Then
        lSuccess = KillTimer(0, TimerID)
        If lSuccess = 0 Then
            MsgBox "The timer failed to deactivate."
        Else
            TimerID = 0
        End If
    End If

End Sub

Private Sub Reminder_Helper(ByVal hwnd As Long, ByVal uMsg As Long, ByVal idevent As Long, ByVal Systime As Long)

Dim ReminderWindowHWnd As Variant

    If idevent = TimerID Then

        On Error Resume Next
        ReminderWindowHWnd = FindWindowA(vbNullString, "1 Reminder")
        SetWindowPos ReminderWindowHWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
        DeactivateTimer

    End If

End Sub

  • Sign the Macro so it will run by going to Tools > Digital Signature... and choosing the certificate you created earlier
  • Close the VBA window
  • Enable all macros in File > Options > Trust Center > Trust Center Settings > Macro Settings
  • Close and re-open Outlook

I would have posted this on the bottom of the other post but it's locked to fresh users like me!

James MacAdie

Posted 2009-09-29T17:05:13.633

Reputation: 111