I have a script in Outlook that runs each time an email is sent to MyFolder. The code saves the attachment as either an Excel or CSV file where the attachment is processed.

I am using If SubFolder.Items.Count = 0 Then to test that an email is in the folder. The problem is that the count is 0 even though an email is definitely in the folder.

I tried refreshing the folder before my code tries to get a handle to the new email. The code tThe code o refresh runs as soon as the email is received before any other code runs.

The code works great if I manually run the Rule after the email is in MyFolder but it does not work when the Rule runs automatically when a new email is received.

Any help greatly appreciated.

Please Login or Register  to view this content.