Solved

Javascript to close Outlook, then wait a few seconds, and then reopen outlook

Posted on 2010-08-25
2
503 Views
Last Modified: 2012-05-10
Hi

I have a very difficult user who never shuts down his outlook, and when he comes in, in the morning, finds out that his Outlook does not work properly.  The solution that I have come up with is to automatically shut down his Outlook for him.  I already have a script to do that (see attached code).  But now he complains that he has to manually open up outlook again, so I was wondering if anyone knew what I can add to allow my code to run, then wait 5 seconds, and then open up outlook again. Any help will be appreciated.
Dim oOL As Outlook.Application
Set oOL = GetObject(, "Outlook.Application")
If oOL Is Nothing Then
    'no need to do anything, Outlook is not running
Else
    'Outlook running
    For i = oOL.Inspectors.count To 1 Step -1
        oOL.Inspectors.Item(i).CurrentItem.Save
        oOL.Inspectors.Item(i).Close True
    Next
    oOL.Session.Logoff
    oOL.Quit
End If
Set oOL = Nothing

Open in new window

0
Comment
Question by:NerishaB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
boing40001 earned 500 total points
ID: 33528945
why don't you just schedule a new task that opens outlook ?
0
 

Author Closing Comment

by:NerishaB
ID: 33530044
It's not in code form, but it is a solution to the problem.  Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question