Scripts - How to
Author
Discussion

fish

Original Poster:

4,063 posts

308 months

Thursday 11th March 2004
quotequote all
How do I write a script to schedule outlook to open up, hence then send receive and more importantly then close itself down at a later point.


Any help appreciated

James

Plotloss

67,280 posts

296 months

Thursday 11th March 2004
quotequote all
You can open it up using a scheduled task.

You can set it to check send and recieve on opening.

Closing it would need a bit of script but if you can leave it open you dont have to...

fish

Original Poster:

4,063 posts

308 months

Thursday 11th March 2004
quotequote all
I'm aware of that but I did want to close it afterwards....

Plotloss

67,280 posts

296 months

Thursday 11th March 2004
quotequote all
Well then you need to communicate with Outlook across the COM sending it the Close method.

Should be simple, plenty of technical forums out there to aid your task.

Mr E

22,902 posts

285 months

Thursday 11th March 2004
quotequote all
Can you not simply leave outlook running and set it to periodically check for new mail?

Or is there a reason that's not good?

Plotloss

67,280 posts

296 months

Thursday 11th March 2004
quotequote all
As I am feeling generous

//This starts outlook
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "outlook"

//Close
oShell.Quit

You will need to control how long its open and the send recieve response yourself.

fish

Original Poster:

4,063 posts

308 months

Thursday 11th March 2004
quotequote all
Thats very kind but I don't know how to do that either.

I've managed an xcopy script though. What is a good site for indicating the main commands for scripts.

Plotloss

67,280 posts

296 months

Thursday 11th March 2004
quotequote all
Look for Outlook API

This will show you the methods and properties connected with Outlook.

The only thing left to code is you need it to not quit until the send/recieve has finished.