Outlook calendar (Delete and update)

' Appointment Item is known and is UNIQUE.
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(strMileage)
If Err.Number <> 0 Then GoTo CannotFindObject
mobjAPPT.Delete
Andi Saputra

I did not know you could use this:
Set mobjAPPT = mobjFLDR.Items(strMileage)
to get your AppointmentItem.

Using something like the mileage field is ok and used by many. But to find it I think you might need to use the "Find" function of Outlook. The following is added after you have your Calendar folder.

Code:
sFilter = "[Mileage] = " & appID & ""
If Not mobjFLDR Is Nothing Then
    Set mobjAPPT = mobjFLDR.Items.Find(sFilter)
end if
 
hi nigel ( you seem to be the expert on this thread!!)

im sorry to bother you, ive been trying to use your code to find/delete appointments and i really am struggling.

when i make a command button on a form which bit of the code to i use and where do i put the rest of the code?

im sorry but my vb skills are very limited as most of my db has used code ive pinched off the internet.

thanks for your help and if you dont want to help i understand perfectly, thmnaks:)
 
Hi Phil

I'll post a sample db. It's pretty easy to understand when you see it working. I'm out at the minute but will do it later tonight


Cheers

Nidge
 

Users who are viewing this thread

Back
Top Bottom