Log in

View Full Version : Run code only for specific calendar when multiple calendars available



renn
01-25-2021, 12:52 AM
Hello everyone,


I'm dealing with a challenge for several weeks, and thought that maybe somone here will be able to solve it.


I'm trying to set a VBA code for outlook that contains several calendars, and the code need to run only for one of them.

The code is running every time a new appointment is created.


I managed to run the code for every calendar on outlook, but couldn’t find out how to check if the appointment is from specific calendar, and only then run the code.

Maybe a "if" line somewhere


Could someone help me with that?



Thanks in advnce!

gmayor
01-25-2021, 06:11 AM
You need to identify the calendar in question by name e.g.


Set olFolder = Session.GetDefaultFolder(olFolderCalendar).Parent.folders("Calendar Name")Then process the message if it is in that folder.