M
Maurice
Hi,
Specs: WinXP - Outlook 2003
I'm calling the Outlook object model from Access. I need to send
appointments based on a recordset. I have three records in the recordset
which are all appointments. I should get three different appointments but i'm
getting one with all the recipients added three times. Pleas take a look at
the code below and tell me what i'm missing:
Code created in Access...
Private sub CheckActions()
Dim rst as ADODB.recordset
Dim objApp as Outlook.Application
Dim objAppointment as Outlook.AppointmentItem
Set objApp =CreateObject("Outlook.Application")
Set objAppointment=objApp.CreateItem(olAppointmentItem)
Set rst=New ADODB.Recordset
rst.open "table",cuurentproject.connection, adOpenDynamic, adLockOptimistic
With rst
if not rst.BOF and not rst.EOF then
select case rst(2) '-> Field which says it's an appointment
with objAppointment
.MeetingStatus=olMeeting
.subject=rst("subjectMeeting")
. recipients.add (rst("addressee")
'-> ect.... (location, start ...)
. Send
end with
case=4 '-> do something else
this is where i do the mail which goes correct...
end select
rst.movenext
end if
end with
rst.close
End sub
My guess is that i have to set a 'new' appointment some how.
Any help appreciated...
Specs: WinXP - Outlook 2003
I'm calling the Outlook object model from Access. I need to send
appointments based on a recordset. I have three records in the recordset
which are all appointments. I should get three different appointments but i'm
getting one with all the recipients added three times. Pleas take a look at
the code below and tell me what i'm missing:
Code created in Access...
Private sub CheckActions()
Dim rst as ADODB.recordset
Dim objApp as Outlook.Application
Dim objAppointment as Outlook.AppointmentItem
Set objApp =CreateObject("Outlook.Application")
Set objAppointment=objApp.CreateItem(olAppointmentItem)
Set rst=New ADODB.Recordset
rst.open "table",cuurentproject.connection, adOpenDynamic, adLockOptimistic
With rst
if not rst.BOF and not rst.EOF then
select case rst(2) '-> Field which says it's an appointment
with objAppointment
.MeetingStatus=olMeeting
.subject=rst("subjectMeeting")
. recipients.add (rst("addressee")
'-> ect.... (location, start ...)
. Send
end with
case=4 '-> do something else
this is where i do the mail which goes correct...
end select
rst.movenext
end if
end with
rst.close
End sub
My guess is that i have to set a 'new' appointment some how.
Any help appreciated...