Results 1 to 5 of 5

Thread: Mail Displayed

  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    Jefferson, PA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would like to have Outlook configured so it would maximize when mail is delivered. That way someone walking by the monitor from a distance would know instantly that mail has been delivered regardless of any other program running at the time, something other than the small icon in the toolbar. The message could then be read and the program minimized. Is there a way to do this?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Yes, you (probably) can!

    Starting in Outlook 2002, one of the actions that can be taken when new mail arrives is to "run a script." Actually, Outlook runs a VBA procedure, which is more powerful and flexible than VBScript. I'm pretty sure that one of the actions available to VBA is to maximize the ActiveExplorer (which presumably will be the Inbox).

    Are you familiar with VBA and the VB Editor built into Outlook? Microsoft has a little bit of help in the knowledge base here: How to create a script for the Rules Wizard in Outlook. You also can find a few short examples here in the Lounge. Or if you need more assistance, please post back with additional questions.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Jefferson has pointed out that you can run code that maximizes the ActiveExplorer. But ... Windows XP (and I presume Windows Vista and Windows 7 too) by default prevent applications from "stealing the focus", so Outlook will be maximized but if it wasn't the active application, it won't become it either.

    For what it's worth, here is a code example. It *must* go into the ThisOutlookSession module, not into a standard module.

    Code:
    Private Sub Application_NewMail()
      With ActiveExplorer
        .WindowState = olMaximized
        .Activate
      End With
    End Sub

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by HansV View Post
    Code:
    Private Sub Application_NewMail()
      With ActiveExplorer
        .WindowState = olMaximized
        .Activate
      End With
    End Sub
    That looks more efficient than using the Rules interface.

    If all other applications are minimized (use the "Show Desktop" icon on the Quick Launch toolbar after checking mail), then this should work.

  5. #5
    New Lounger
    Join Date
    Dec 2009
    Location
    Jefferson, PA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for all your help. I'm not all that familiar with running scripts but will give it a go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •