VBA script to modify all Outlook Calendar items


Using the script below you may automate the process of putting birthdays in your calendar. This is the 2 step process. First - you import your birthdays list from .xls file to Outlook calendar and second - you run the script to make all appointments to be recurring.

So this script will modify all (multiple) Outlook Calendar items to be rucurring yearly:


Sub replacement()

 Dim Ns As NameSpace
 Dim MyCalendar As MAPIFolder
 Dim Item As Object

 Set Ns = GetNamespace("MAPI")
 Set MyCalendar = Ns.GetDefaultFolder(olFolderCalendar)
 Set srtitems = MyCalendar.Items
  
 For Each Item In srtitems
 DoEvents
   Set myRecurrPatt = Item.GetRecurrencePattern
    myRecurrPatt.RecurrenceType = olRecursYearly
    Item.Save
 Next
End Sub

Comments

Popular posts from this blog

How to uninstall a broken software

Xerox 116-324 fault when printing .doc or .pdf containing callibri fonts

Create Outlook calendar item with Python