

- #WINDOWS BREAK REMINDER PROGRAM WINDOW POP UP DISSAPPEAR UPDATE#
- #WINDOWS BREAK REMINDER PROGRAM WINDOW POP UP DISSAPPEAR CODE#
- #WINDOWS BREAK REMINDER PROGRAM WINDOW POP UP DISSAPPEAR WINDOWS#
Private Const FLAGS As Long = SWP_NOMOVE Or SWP_NOSIZE Private Declare Function SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, _īyVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Declare Function ShowWindow Lib "User32" (ByVal hWnd As Long, ByVal nCmdSHow As Long) As Long Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName _Īs String, ByVal lpWindowName As String) As Long Private Declare Function IsWindowVisible Lib "User32" (ByVal hWnd As Long) As Long Private Declare Function KillTimer Lib "User32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long Private Declare Function SetTimer Lib "User32" (ByVal hWnd As Long, ByVal nIDEvent As Long, _īyVal uElapse As Long, ByVal lpTimerfunc As Long) As Long Private Sub MyReminders_ReminderFire(ByVal ReminderObject As Reminder)
#WINDOWS BREAK REMINDER PROGRAM WINDOW POP UP DISSAPPEAR CODE#
Instead - I assumed the reminders window once instantiated was merely hidden and not destroyed when reminders were shown as such I now keep a global handle to the window so I should only need to look once at the window titles and subsequently check if the reminders window is visible before making it modal.Īlso - the timer is now only employed when the reminders window is triggered, then turned off once the function has run hopefully stopping any intrusive macro's running during the working day.Īdd the following code to the 'ThisOutlookSession' module Private WithEvents MyReminders As Outlook.Reminders
#WINDOWS BREAK REMINDER PROGRAM WINDOW POP UP DISSAPPEAR WINDOWS#
Having rethought my approach and based on observation - I redesigned the code to try and have a minimal impact on working while Outlook was open I would find the timer still took focus away from e-mails I was writing and possibly other issues with windows losing focus might have been related. If you routinely have a larger number of reminders than 10 popup then you could increase this number in the EventMacro sub. The FindReminderWindow function takes a value which is the number of iterations to step through to find the window. This now works for me in 2013 and should work for versions below 2013. I have now updated it with a further function (FindReminderWindow) that looks for a range of popup reminder captions. Having transitioned to Outlook 2013 - this code stopped working for me. It's a massive hassle as you're writing an e-mail.Īs such I upgraded the code so that the timer only runs every 60 seconds then upon finding the first active reminder, the timer is stopped and the secondary event function is then used forthwith to activate the window focus change. Then melding the two solutions together gave a working solution to this problem.įrom the trust centre, I enabled the use of macros then opening the visual basic editor from Outlook (alt+F11) I added the following code to the 'ThisOutlookSession' moduleĪfter using this for a while I found a real annoyance with the fact that triggering the timer removes the focus from the current window. Taking the code from the following website Outlook VBA - Run a code every half an hour To get around this, I looked to employ a timer to periodically test if the window was present and if it was, then bring it to the front. based on the code I assumed this was because the window wasn't detected until it had instantiated once However as noted in the comments, the first reminder failed to popup while further reminders then did.
#WINDOWS BREAK REMINDER PROGRAM WINDOW POP UP DISSAPPEAR UPDATE#
For the latest macro please see update 4 (Office 365 inclusion)Īfter searching for a while I found a partial answer on a website that seemed to give me the majority of the solution
