Click here to Skip to main content
15,887,214 members
Articles / Productivity Apps and Services / Microsoft Office
Tip/Trick

Make Outlook E-mail and Appointment Alerts 'top most'

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
16 Dec 2015CPOL2 min read 9.5K   120   3   2
Use this if you're working in a fullscreen RDP session - for example - to see new e-mail or appointment alerts

Introduction

I've been working in fullscreen RDP sessions recently and miss having Outlook tell me when I've received e-mails or when the Friday afternoon pub session is about to start.

Background

I had assumed that a quick call to SetWindowPos in response to a ThisOutlookSession event would suffice.

Wrong! :(

The events occurs BEFORE the window has been created and displayed so the tricky part here is to use Windows timers to wait a while before executing the SetWindowPos call.

Using the Code

  • Open Outlook
  • Open the VBA IDE (Alt-F11)
  • Unzip the attached file to import the class, module and form definitions
  • You will now have an extra 'ThisOutlookSession' class under 'Class Modules'
    Move/merge the code in there into the 'ThisOutlookSession' class definition under 'Microsoft Office Outlook Objects'
  • Your project should now look something like this:

Enable the 'New Mail Alerts' Dialog

Now, you have all the code you need to ensure that you're getting e-mail alerts.

For example:

  • In Outlook 2013, look under 'File' for 'Rules and Alerts':

  • Check that the 'New Mail' rules is enabled:

  • ... or create a rule that displays the 'New mail' window when required.

Self Certification

Because you've added code to the Outlook Session, you will now be prompted to enable macros each time you run Outlook:

To overcome this, you could create a certificate for your workstation and sign your VBA project with it.

See http://www.howto-outlook.com/howto/selfcert.htm.

Points of Interest

The mdlExecutor module is an example of a generic way to fire 'actions' after a period of time using the TAction class.

IAction is the interface used by the mdlExecutor module and TMakeTopmostAction is a simple example of how it's possible to define an interface (in this case IAction) and implement it elsewhere.

History

  • v0.1: Initial draft
  • v0.2: Corrected image urls
  • v0.3: Only change the alert Window's style if it needs changing
    NOTE: Mail alert windows seem to perisist while appointment windows are re-created.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionNo images? Pin
Uwe Keim9-Dec-15 20:56
sitebuilderUwe Keim9-Dec-15 20:56 
GeneralRe: No images? Pin
maxitone9-Dec-15 21:41
maxitone9-Dec-15 21:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.