Solved

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

Posted on 2010-08-25
2
488 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
2 Comments
 
LVL 5

Accepted Solution

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

Author Closing Comment

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now