JoeMarfice
08-16-2007, 02:28 PM
OK, I feel like a complete dolt here, but for the life of me - I cannot figure out how to pass an object in.
Here's an example program:
' ***********
Sub RemoveDuplicateAppointments()
Dim mapiAppointments As MAPIFolder
Dim itmAppointment As AppointmentItem
Set mapiAppointments = Outlook.Application. _
GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar)
For Each itmAppointment In mapiAppointments.Items
StripDoubleQuotesFromAppointment (itmAppointment)
Next itmContact
End Sub
Sub PlayWithAppointment(itmAppointment As AppointmentItem)
' Do something.
End Sub
' ***********
So, in theory, the subroutine PlayWithAppointment would receive an Appointment Object, and do something with it. But instead, I get the error:
Run-time error '91':
Object variable or With block variable not set.
Can someone steer me to the right path?
TIA, a whole bunch.
Here's an example program:
' ***********
Sub RemoveDuplicateAppointments()
Dim mapiAppointments As MAPIFolder
Dim itmAppointment As AppointmentItem
Set mapiAppointments = Outlook.Application. _
GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar)
For Each itmAppointment In mapiAppointments.Items
StripDoubleQuotesFromAppointment (itmAppointment)
Next itmContact
End Sub
Sub PlayWithAppointment(itmAppointment As AppointmentItem)
' Do something.
End Sub
' ***********
So, in theory, the subroutine PlayWithAppointment would receive an Appointment Object, and do something with it. But instead, I get the error:
Run-time error '91':
Object variable or With block variable not set.
Can someone steer me to the right path?
TIA, a whole bunch.