Mass Outlook Calendar Cleanup

Over the last few weeks the company that I work for have been migrating from Google Apps over to Microsoft 365 for mail/calendar/contacts and unified messaging etc. This has not been without it’s challenges. Some have which have been fairly bizarre. This week I was approached by a member of our department who had somehow managed to end up with 10,000+ appointments of the same title in his calendar. We set about trying to remove them on mass using the Outlook GUI, but soon realised this would take a very long time. Which is when I put together the following snippet of VBA:

NB: This code ‘takes no prisoners, and straight deletes the appointments matching the criteria you pass it. This wouldn’t be easy to undue if you ran with incorrect parameters. I’d advise adding a break point and testing a few before letting it hit your entire calendar folder.

Dim myNameSpace As NameSpace
Dim myCalendar As Folder
Dim myAppts As Items
Dim myAppt As AppointmentItem
Dim i As Integer

Sub purge_cal()
    Set myNameSpace = Outlook.Application.GetNamespace("MAPI")
    Set myCalendar = myNameSpace.GetDefaultFolder(olFolderCalendar)

    Set myAppts = myCalendar.Items
    i = 0
    For Each myAppt In myAppts
        If myAppt.Subject = "" Then
            i = i + 1
            Debug.Print "Deleting " & myAppt.Subject
            myAppt.Delete

        End If
    Next
        Debug.Print i & " calendar items deleted"
End Sub

Read More

Fix: Constant credential prompts in Outlook ’07 using 365

20130510-124333.jpg

Today I have mostly been fighting with Microsoft Office Outlook 2007 and our Office 365 setup, as we are still in the early stages of deployment we have not yet implemented our ADFS servers. Which means we have are experiencing some pretty frustrating issues with Office and authentication.

One machine in particular decided to really test my patience and blankly refused to authenticate, presenting the user with a constant reoccurrence of the “Welcome back to Outlook.Office365” login box.

As it happened the machine had seemed to avoid the installation of several service packs, including Office 2007 Service Pack 3, and also what turned out to be some pretty important KB hot fixes. Leaving me scratching my head for what seemed like a lifetime… That was until today! When I finally managed to find the relevant KB hot fixes and install them manually..

OFFICE VERSION NOTES
Latest version of Office System requirements for Office 2013 and Office 365 ProPlus
Office 2010 with Service Pack 1 Automatic updates:

  • Customers who sign up for Office 365 after February 27, 2013, must apply all automatic updates that were released before December 2012.
  • Customers who signed up for Office 365 before February 27, 2013, must complete the following:
    • By July 1, 2013, apply KB2553248.
    • By April 8, 2014, apply all automatic updates for Office 2010 that were released prior to December 2012.
Office 2007 with Service Pack 3 Automatic updates:

  • Customers who sign up for Office 365 after February 27, 2013, must apply all automatic updates that were released before December 2012.
  • Customers who signed up for Office 365 before February 27, 2013, must complete the following:
    • By October 1, 2013, apply KB2596598.
    • By April 8, 2014, apply all automatic updates for Office 2010 that were released before December 2012.
Office 2003 only through POP and IMAP For more information, see Office 365 will now support POP and IMAP connections to Outlook 2003.
Office for Mac 2011 with Service Pack 3 Mac OS X 10.6 or later is required.
Office 2008 for Mac 12.2.9 Support ends April 9, 2013.

The journey to 365 has been a long and winding one… This particular highlights the importance of ensuring all machines connecting to 365 are bang up to date with Windows and Office updates and service packs… Lesson learnt.

Read More