I tried to write a script, that counts the e-Mails in a specific public exchange folder in outlook. If there are Mails in subfolder2, a Messagebox should open and tell me, how many Mails there are. I tried this, but it did not work.
Outlook := ComObjActive("Outlook.Application")
mail = (Outlook.Application.ActiveExplorer().Session.GetDefaultFolder(18).Folders("Subfolder\Subfolder2")
if (mail.Items.Count>0)
{
msgbox % mail.Items.Count "Mails in folder"
}
else
{
msgbox No Mails.
}
Does anyone has a idea, how I should change the script, that it works?
I got it. I simply removed the Variable.
Thanks for the help :D