robyholmes
Registered User.
- Local time
- Today, 22:42
- Joined
- Mar 2, 2009
- Messages
- 57
I want to delete all appointments in my calendar with * in the subject. This code (Just a small bit of it) deletes the subjects when strFindAppt = Subject, but I need to find appointments with * in them, not * as the subject without anything else.
strFindAppt = strFindAppt
' Use this method ONLY if the subject of the
' Appointment Item is known and is UNIQUE.
strFindAppt = "*"
Set mobjOLA = CreateObject("Outlook.Application")
Set mobjNS = mobjOLA.GetNamespace("MAPI")
mobjNS.Logon , , False, False
Set mobjFLDR = mobjNS.GetDefaultFolder(olFolderCalendar)
On Error Resume Next
Set mobjAPPT = mobjFLDR.Items(strFindAppt)
If Err.Number <> 0 Then GoTo CannotFindObject
mobjAPPT.Delete
strFindAppt = strFindAppt
' Use this method ONLY if the subject of the
' Appointment Item is known and is UNIQUE.
strFindAppt = "*"
Set mobjOLA = CreateObject("Outlook.Application")
Set mobjNS = mobjOLA.GetNamespace("MAPI")
mobjNS.Logon , , False, False
Set mobjFLDR = mobjNS.GetDefaultFolder(olFolderCalendar)
On Error Resume Next
Set mobjAPPT = mobjFLDR.Items(strFindAppt)
If Err.Number <> 0 Then GoTo CannotFindObject
mobjAPPT.Delete