Modify all calendar items to be Private using VBA

M

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.
 
K

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
Err.Clear
Else
oAppt.Sensitivity = olPrivate
oAppt.Save
End If
Next
End Sub
 
Top