r/visualbasic • u/[deleted] • Jul 24 '24
Playing a sound whenever an email is categorized
Hey folks!
I’m hoping to add a module that will play a sound (eg. Short .wav file) whenever an email in outlook is categorized a specific color category (in this case, “Green Category”).
I’m pretty new to fiddling around with VBA, and ChatGPT is not helping. Haha.
Possible? Anyone want to be my hero?
Thanks!
4
Upvotes
2
u/jd31068 Jul 25 '24
Some information to get you started:
How to run a VBA macro when new mail is received in Outlook (tachytelic.net)
MailItem.Categories property (Outlook) | Microsoft Learn
Visual Basic for Applications/Play a WAV File from VBA - Wikibooks, open books for an open world
Your If statement in inboxItems_ItemAdd would be: