Hi,
After much fiddling about I was able to adapt some Microsoft automation code that allowed me to add a calendar reminder in Outlook 2000 after clicking a button on a form in Access 2000.
At the moment this sets a reminder on my own PCs Outlook calendar. What I want to do is set up a reminder on a shared calendar for other colleagues, but am a bit stuck.
The shared calendar is called 'Marketing Reminders' and the code as it stands is below.
Any help is much appreciated, but I am a bit of a VB novice, so bear that in mind.
cheers,
Alex
Private Sub addTask_Click()
On Error GoTo Add_Err
'Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Me!FOLLOWUPCALLBACK & " " & Me!FOLLOWUPCALLBACK_TIME
.Subject = Me!Company & " - " & Me!NEXTACTION
.Duration = 0
.ReminderSet = True
.ReminderMinutesBeforeStart = 0
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
'Release the Outlook object variable.
Set objOutlook = Nothing
'Set the AddedToOutlook flag, save the record, display a message.
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
Add_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub
After much fiddling about I was able to adapt some Microsoft automation code that allowed me to add a calendar reminder in Outlook 2000 after clicking a button on a form in Access 2000.
At the moment this sets a reminder on my own PCs Outlook calendar. What I want to do is set up a reminder on a shared calendar for other colleagues, but am a bit stuck.
The shared calendar is called 'Marketing Reminders' and the code as it stands is below.
Any help is much appreciated, but I am a bit of a VB novice, so bear that in mind.
cheers,
Alex

Private Sub addTask_Click()
On Error GoTo Add_Err
'Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Me!FOLLOWUPCALLBACK & " " & Me!FOLLOWUPCALLBACK_TIME
.Subject = Me!Company & " - " & Me!NEXTACTION
.Duration = 0
.ReminderSet = True
.ReminderMinutesBeforeStart = 0
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
'Release the Outlook object variable.
Set objOutlook = Nothing
'Set the AddedToOutlook flag, save the record, display a message.
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
Add_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub