aspiringnerd
New Member
- Joined
- Apr 22, 2022
- Messages
- 39
- Office Version
- 365
- Platform
- Windows
So I currently have the following code that creates a new event based on values I have in a table. I need help creating a vba script that will open the event this generates whenever there is a change in my table so I can synch them together.
VBA Code:
Sub FindAndSync()
Set olOutlook = CreateObject("Outlook.Application")
Set Namespace = olOutlook.GetNamespace("MAPI")
Set myRecipient = Namespace.CreateRecipient("sharedcalendar@outlook.com")
Set oloFolder = Namespace.GetSharedDefaultFolder(myRecipient, 9)
Set Appointment = oloFolder.items.Add
With Appointment
.AllDayEvent = True
.Reminderset = False
.Start = Cells(ActiveCell.Row, "H").Value
.End = Cells(ActiveCell.Row, "I").Value
.Categories = Cells(ActiveCell.Row, "J").Value
.Subject = Cells(ActiveCell.Row, "K").Value
.display
End With
End Sub