Forum Discussion
Greg Edwards
Dec 14, 2017Iron Contributor
Aggregate availability from multiple calendars
I prefer to keep personal appointments on one calendar (on Outlook.com) and work appointments on my work calendar (O365 Exchange), but Exchange only seems to use my work calendar to show my availability to other people in my organization. I'd like to have a way to aggregate my availability from multiple calendar sources, the way that you can overlay multiple calendars in Outlook. It's not really a matter of me seeing all my appointments, because I can easily see everything in a consolidated view in Outlook on my desktop or mobile; it's more about letting others in my organization know when I'm free to meet. I know there is (used to be?) a "free/busy server" option in Outlook client, but I feel like this should be something that can be set on my Exchange profile, so that it doesn't matter what client I'm using.
Aside from that kind of option, I guess I'd guess I might be OK with a solution that duplicates anything added to my personal calendar as a block on my work calendar or vice versa, even if it's an IFTTT-type thing. I saw a similar post that mentions some 3rd-party tools from CodeTwo and Connecting Software, but given this is just a preference of mine, I'm probably not going to spend a lot on a workaround.
TLDR: Is there a better approach to showing consolidated availability than manually duplicating my appointments between calendars? Thanks!
- AusteniteCopper Contributor
I just spent a couple of hours with Copilot and have come up with a VBA Macro solution that's working perfectly for me.
It works for adding, moving and deleting items, in the calendars for two IMAP accounts and making a "Busy" appointment in a third IMAP account. It could easily be extended to any number of IMAP accounts, not sure about other types.
In the VBA code, the places to change the source emails are obvious, but there are three places to change to your target email.
Enabling Macros in Outlook
Open Outlook:
Access the Trust Center:
Go to File > Options.
- In the Outlook Options dialog, select Trust Center from the left pane.
- Open Trust Center Settings:
- Click the Trust Center Settings... button.
Enable Macros:
In the Trust Center dialog, select Macro Settings from the left pane.
Choose one of the following options:
- Disable all macros without notification: Macros are disabled without any notifications.
- Notifications for all macros: Macros are disabled, but you will get a notification each time you try to run a macro.
- Enable all macros (not recommended, potentially dangerous code can run): All macros are enabled. (This is not recommended due to security risks.)
- Disable all macros except digitally signed macros: Unsigned macros are disabled, and notifications are shown. Signed macros are enabled.
Click OK to save the settings.
What Happens on Each Startup if the Macro is Not Signed
If your macro is not signed and your macro settings are set to disable all macros except digitally signed macros or to notify for all macros, the following will happen on each startup:
Security Warning:
You will receive a security warning notification indicating that macros have been disabled. This is to prevent potentially harmful code from running.
Enabling Macros Manually:
You will need to manually enable macros each time you start Outlook. To do this, click the Enable Content button in the security warning notification.
Potential Security Risks:
Unsigned macros are considered potentially dangerous because they could contain malicious code. It's essential to ensure that the source of your macros is trusted.
Installing the VBA Code
Start Outlook and press Alt + F11 to open the VBA editor.
Create a New Module:
- In the VBA editor, locate the Project Explorer window (usually on the left side). If it's not visible, press Ctrl + R to open it.
- In the Project Explorer, find the project corresponding to your Outlook session (it should be labeled something like "VbaProject.OTM").
- Right-click on the project, select Insert, and then Module.
Paste the Code:
- Copy the provided VBA code and paste it into the new module.
Save the Project
- Save your VBA project by clicking the Save button or pressing Ctrl + S.
Signing the VBA Code
Create a Digital Certificate:
If you don't have a digital certificate, you can create a self-signed certificate:
Go to the Windows Start menu, search for Selfcert.exe, and run it.
In the Create Digital Certificate dialog, enter a name for the certificate (e.g., "OutlookVBA") and click OK.
(This didn't work for my, but there was an already installed certificate that did.)
Open the VBA Project Properties:
In the VBA editor, go to Tools > Digital Signature.
Choose a Digital Certificate:
In the Digital Signature dialog, click Choose.
Select the certificate you created (e.g., "OutlookVBA") and click OK.
Save and Close the VBA Project:
Save the VBA project by clicking the Save button or pressing Ctrl + S.
Close the VBA editor by clicking the X button or pressing Alt + Q.
Restart Outlook
Close Outlook and then reopen it to ensure the VBA code is loaded and the digital certificate is applied.
Here's the VBA code:
Private WithEvents Items1 As Outlook.Items Private WithEvents Items2 As Outlook.Items Private WithEvents Folder1 As Outlook.Folder Private WithEvents Folder2 As Outlook.Folder Private Sub Application_Startup() Dim ns As Outlook.NameSpace Dim imapCalendar1 As Outlook.Folder Dim imapCalendar2 As Outlook.Folder Set ns = Application.GetNamespace("MAPI") ' Set up for the first source email account Set imapCalendar1 = ns.Folders("email address removed for privacy reasons").Folders("Calendar") Set Items1 = imapCalendar1.Items Set Folder1 = imapCalendar1 ' Set up for the second source email account Set imapCalendar2 = ns.Folders("email address removed for privacy reasons").Folders("Calendar") Set Items2 = imapCalendar2.Items Set Folder2 = imapCalendar2 End Sub Private Sub Folder1_BeforeItemMove(ByVal Item As Object, ByVal MoveTo As MAPIFolder, Cancel As Boolean) HandleBeforeItemMove Item, MoveTo End Sub Private Sub Folder2_BeforeItemMove(ByVal Item As Object, ByVal MoveTo As MAPIFolder, Cancel As Boolean) HandleBeforeItemMove Item, MoveTo End Sub Private Sub HandleBeforeItemMove(ByVal Item As Object, ByVal MoveTo As MAPIFolder) On Error Resume Next Dim ns As Outlook.NameSpace Dim destCalendar As Outlook.Folder Dim copiedAppointment As Outlook.AppointmentItem Dim entryID As String If MoveTo = "Deleted Items" Then ' Item is being deleted If TypeOf Item Is Outlook.AppointmentItem Then entryID = Item.UserProperties("CopyID").Value If entryID <> "" Then Set ns = Application.GetNamespace("MAPI") ' Change "Destination Calendar" to the name of your destination calendar Set destCalendar = ns.Folders("email address removed for privacy reasons").Folders("Calendar") ' Find the copied appointment by EntryID Set copiedAppointment = ns.GetItemFromID(entryID) If Not copiedAppointment Is Nothing Then copiedAppointment.Delete End If End If End If End If On Error GoTo 0 End Sub Private Sub Items1_ItemAdd(ByVal item As Object) If TypeOf item Is Outlook.AppointmentItem Then CopyAppointmentToAnotherCalendar item End If End Sub Private Sub Items2_ItemAdd(ByVal item As Object) If TypeOf item Is Outlook.AppointmentItem Then CopyAppointmentToAnotherCalendar item End If End Sub Private Sub Items1_ItemChange(ByVal item As Object) If TypeOf item Is Outlook.AppointmentItem Then UpdateAppointmentInAnotherCalendar item End If End Sub Private Sub Items2_ItemChange(ByVal item As Object) If TypeOf item Is Outlook.AppointmentItem Then UpdateAppointmentInAnotherCalendar item End If End Sub Private Sub CopyAppointmentToAnotherCalendar(App As Outlook.AppointmentItem) On Error Resume Next Dim ns As Outlook.NameSpace Dim destCalendar As Outlook.Folder Dim newAppointment As Outlook.AppointmentItem Set ns = Application.GetNamespace("MAPI") ' Change "Destination Calendar" to the name of your destination calendar Set destCalendar = ns.Folders("email address removed for privacy reasons").Folders("Calendar") Set newAppointment = destCalendar.Items.Add(olAppointmentItem) With newAppointment .Start = App.Start .End = App.End .Subject = "Busy" .ReminderSet = False ' Set reminder to None ' Uncomment the lines below to copy additional appointment details ' .Location = App.Location ' .Body = App.Body ' .RequiredAttendees = App.RequiredAttendees ' .OptionalAttendees = App.OptionalAttendees ' .AllDayEvent = App.AllDayEvent ' .BusyStatus = App.BusyStatus ' .Categories = App.Categories If App.IsRecurring Then Dim pattern As Outlook.RecurrencePattern Set pattern = App.GetRecurrencePattern Dim newPattern As Outlook.RecurrencePattern Set newPattern = newAppointment.GetRecurrencePattern newPattern.RecurrenceType = pattern.RecurrenceType newPattern.Interval = pattern.Interval ' Handle other recurrence settings here End If .Save ' Save the EntryID of the new appointment to link it Dim userProperty As Outlook.userProperty Set userProperty = App.UserProperties.Add("CopyID", olText) userProperty.Value = newAppointment.entryID App.Save End With On Error GoTo 0 End Sub Private Sub UpdateAppointmentInAnotherCalendar(App As Outlook.AppointmentItem) Dim ns As Outlook.NameSpace Dim destCalendar As Outlook.Folder Dim copiedAppointment As Outlook.AppointmentItem Dim entryID As String On Error Resume Next entryID = App.UserProperties("CopyID").Value If entryID <> "" Then Set ns = Application.GetNamespace("MAPI") ' Change "Destination Calendar" to the name of your destination calendar Set destCalendar = ns.Folders("email address removed for privacy reasons").Folders("Calendar") ' Find the copied appointment by EntryID Set copiedAppointment = ns.GetItemFromID(entryID) If Not copiedAppointment Is Nothing Then With copiedAppointment If App.IsRecurring Then Dim pattern As Outlook.RecurrencePattern Set pattern = App.GetRecurrencePattern Dim newPattern As Outlook.RecurrencePattern Set newPattern = copiedAppointment.GetRecurrencePattern newPattern.RecurrenceType = pattern.RecurrenceType newPattern.Interval = pattern.Interval ' Handle other recurrence settings here Else .Start = App.Start .End = App.End End If .Save End With End If End If On Error GoTo 0 End Sub
- BSAAMCopper Contributor
Greg Edwards Not that this answers the question of being better than duplicating events, I've 'solved' the availability issue by:
- Creating a GCal for the purpose of amalgamating 'secondary' calendars
- Using this script to import webcal links from my multiple secondary calendars into the main GCal calendar
- Connecting the GCal to my main (work) calendar as my 'personal' account.
As a result, my availability from my multiple secondary calendars are all now displayed in my main work calendar to colleagues.
- Brian-TheNRGguyCopper Contributor
Why does MS not solve this problem. It seems so easy.
1.) Add an "Availability Calendar"
2.) Let users decide, what calendars feed into it, and level of detail.
3.) Provide ability to not include, specific items. ie By default all events show, however the user can open the specific event and choose to not include it in the "Availability Calendar".
- danielvivarCopper Contributor
Greg Edwards
You can do that now with "Add personal account" feature, check documentation here: https://support.microsoft.com/en-us/office/show-personal-events-on-your-work-or-school-calendar-6ffc71a9-0943-415a-8482-ce0122528a35- aco_stulicCopper ContributorGreat.. we are getting somewhere here. But this is just an option for Outlook or Gmail, and I need an iCloud option to add in my Apple account… as I run my personal life through that iCloud account.
Please can this be added soon?
- joncrosbyCopper Contributor
I'm constantly baffled that MSFT hasn't addressed this issue, it's not that hard and will make the Bookings product actually useable! Here is my FREE Calendly hack for this in case it helps anyone else in the future:
1. Setup a Google Calendar account you can use to just for calendar syncing. (e.g. mycalendarsync at gmail dot com).
2. Go to your online Outlook account and click 'Share' on the calendar you want to sync, and then put in the Gmail address you just created. You will get a link to then go to your new Google calendar and then add new 'Other' calendar as web subscription.
3. Setup a free Calendly account using your normal calendar/email.
4. In the Calendar Sync section, add the sync Google calendar you created earlier, then in 'Check for conflicts' hit Edit and choose those subscribed calendars from your new google calendar.
Not sure how scalable this is but it works for the 4-5 calendars I'm trying to sync and provides me a share URL I can use for my clients. - Brian-TheNRGguyCopper ContributorThis has been a frustration for me... for years!!! This is such an obvious feature that is needed!
Makes me hate using MS365!!! instead of helping me, by making their products more productive.... The give me new "emoje"s . I do not need "cute" I need things that make me faster than my coemption! Don't get me started on how hard it to MS apps on your phone....might as well sit at my computer. - mosesriveraCopper Contributor
Greg Edwards I haven't found a way to merge the availability across calendars. For now, I've ditched my various Outlook calendars and replaced them with the built-in Categories feature (all calendar events are within the default calendar). Although I haven't found a way to quickly show/hide calendars based on Categories, I'm questioning whether I truly need to do so.
- luffy13Copper ContributorI've been having this issue recently, and I came across this question. After some research, I found https://www.onecal.io/
This tool has been working like a charm. - mrmike_evoCopper Contributor
Greg Edwards https://calendarbridge.com/ solved it for me.
- MMreedCopper ContributorDid anyone find a solution? I have 2 sub calendars for groups of tasks and need them separated bc I allow others access to my appts. I dont want everyone to have access to everything.
My prob is that my teams acct only pulls information from my main calendar so I am getting double booked with meetings.. thanks- Michael_Johnson990Copper Contributor
MMreed I set up a Zap in Zapier to copy events from another calendar into my work calendar. I wanted to show my time as busy whenever there was a men's basketball game for my alma mater. So I pointed the Zap to a public calendar for the team's schedule and had it add events to my work calendar whenever a new game was posted.
The nice thing about using Zaps is that you can make the event title anything you want--have it fill in information from the other calendar directly, or call it something innocuous (like "Personal").
Here's a link to my Zap:
https://zapier.com/shared/6b3640fe05514bec57f84cc902f9b9d9d2a88b2b
- embeddedcapCopper Contributor
Michael_Johnson990 How do you remove the Reminder so you don't double your reminders in Outlook? Zapier wasn't giving me the choice of Reminder.
it's crazy after 7 years this still isnt solved by microsoft and we have to come up with workarounds