Modify all calendar items to be Private using VBA


Michael Mahony

I want to go through my Outlook calendar items and mark everything
private. Is there a simple way I can accomplish this using VBA? It
is just a one time thing. Once they are marked as private I'll
maintain the appointments in the proper context from that point
onward. I need to do this because I am implementing a new calendar
sharing system at the office and don't want all my personal
appointments open to the public. :) Thanks.

Ken Slovak - [MVP - Outlook]

Assuming there are only appointment items in the folder:

Sub MakeAllPrivate()
Dim oFolder As Outlook.MAPIFolder
Dim oItems As Outlook.Items
Dim oAppt As Outlook.AppointmentItem

On Error Resume Next

Set oFolder = Application.Session.GetDefaultFolder(olFolderCalendar)
Set oItems = oFolder.Items
For Each oAppt In oItems
If Err Then
oAppt.Sensitivity = olPrivate
End If
End Sub
May 3, 2015
Reaction score
Hi Ken. i am new to vba and not a programmer.
Is there a way to reverse this code to make all appointments public please?
Thanks Gordon

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question