aspiringnerd
New Member
- Joined
- Apr 22, 2022
- Messages
- 39
- Office Version
- 365
- Platform
- Windows
I'm hoping that it's just as simple as replacing the 3rd line with a different namespace paramater, perhaps namespace.getshareddefaultfolder? I just don't know how to make it work, I'm struggling with the syntax on the ms website.
I added a comment in the code where I'm pretty sure I need to replace it with but I'm stuck, documentation isn't super clear on my specific need.
I added a comment in the code where I'm pretty sure I need to replace it with but I'm stuck, documentation isn't super clear on my specific need.
VBA Code:
Sub new_event()
Set olOutlook = CreateObject("Outlook.Application")
Set Namespace = olOutlook.GetNameSpace("MAPI")
Set oloFolder = Namespace.GetDefaultFolder(9) 'this writes to my calendar, but I'd like to write it to a default calendar shared by someone else to me
Set Appointment = oloFolder.items.Add
With Appointment
.AllDayEvent = True
.Start = Cells(ActiveCell.Row, "T").Value
.End = Cells(ActiveCell.Row, "U").Value
.Categories = Cells(ActiveCell.Row, "V").Value
.Subject = Cells(ActiveCell.Row, "W").Value
.Display
End With
End Sub