There's no way to tell if the send/receive is finished usually.
You can use the SyncObjects collection and initiate a synch in your code and
then handle the synch end event. That would work, usually most people have 1
defined send/receive group, but if there are more it can be very hard to
tell which accounts are being sent with which groups.
Look at
http://www.outlookcode.com/threads.a...essageid=16184
for some sample code using syncobjects, it might help.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"mecg96" wrote in message
...
Hi Ken,
Thanks for the help. It's working now, but I have another problem. After
all
the messages are sent I close the .pst file. The problem is that for the
last
messages the send/receive is still active when the close .pst command
executes. I tried with the "Doevents" after the Send/Receive, but it
didn't
work. Is there a way of telling the macro to wait until the send/receive
finishes?
Thx!