I am trying to remove Outlook appointments with a specific subject using VBA:
This generates the following error message half way through the removal process (tranlated from Dutch original):
Any suggestions welcome.
Code:
Set MyApp = CreateObject("Outlook.Application")
Set MyNS = MyApp.GetNamespace("MAPI")
Set MyFolder = MyNS.GetDefaultFolder(olFolderCalendar)
Set MyItems = MyFolder.Items
MyTotal = MyItems.Count
For i = 1 To MyTotal
If (Left(MyItems.Item(i).Subject, 3) = "UA:") Then
MyItems.Item(i).Delete
End If
Next i
This generates the following error message half way through the removal process (tranlated from Dutch original):
Code:
Run-time error '-382599159 (e9320009)'
The limits of the matrix index have been exceeded
Any suggestions welcome.