Article ID: 201102
Article Last Modified on 11/23/2006
Sub RemoveAppt()
Dim myOLApp As Outlook.Application
Dim olns As Outlook.Namespace
Dim mymail As String
Dim myRecip As Outlook.Recipient
Dim MyFolder As MAPIFolder
Dim day1 As String
Dim MyAppts As Outlook.Items
Dim MyAppt As Outlook.AppointmentItem
Set myOlApp = New Outlook.Application
Set olns = myOlApp.GetNameSpace("MAPI")
mymail = "johndoe"
Set myRecip = olns.CreateRecipient(mymail)
myRecip.Resolve
If myRecip.Resolved Then
Set MyFolder = olNS.GetSharedDefaultFolder(myRecip,olFolderCalendar)
day1 = "1/1/99 9:00 AM"
Set MyAppts = MyFolder.Items
Set MyAppt = MyAppts.Find("[Start] = """ & day1 & """")
If MyAppt Is Nothing Then
MsgBox "Appointment not found."
Else
MyAppt.Delete
End If
Else
MsgBox "Could not resolve e-mail name"
End If
End Sub
146636 OL2000: Questions About Custom Forms and Outlook Solutions
Additional query words: OutSol OutSol2000 OL2K
Keywords: kbinfo KB201102