How to detect when a send\receive is complete?

  • Thread starter Thread starter tomasstein
  • Start date Start date
T

tomasstein

Hi all,

I have written (or in the process of) a program to externally dial
up my companies VPN, start outlook, and issue the "send\recieve"
command. The program then waits for 10 minutes and then closes
outlook and disconnects my VPN. I am currently closing the
application by sending a WM_CLOSE message.

I would like to come up with a better way of determing when the send
\receive operation is complete. I'm not very experienced with
outlook programming, but some thoughts I have:

1) Is there a built-in close\exit type operation? If I used that,
would it automatically exit when the send\recieve is complete?

2) I could maybe go and read the text window on the status bar and
see when it says "Send\Receive Complete" and then exit as I have
been.

Anyway, how should I be doing this?

Thanks,
Tomas
--
 
Look at the Namespace.SyncObjects collection. SyncObject.SyncEnd event will
fire when the sync is completed. NOte that it will only fire for the sync
objects instantiated and started explicitly in your code.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top