?
Solved

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

Posted on 2010-08-25
2
Medium Priority
?
506 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

718 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