By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Cancelling Outlook meeting requests

P: 8
I have a database that is used to book venues and assign people to those venues. The person doing the booking can send an appointment request from Access to an individuals Outlook calendar. This part of the system works fine.

I can also send a cancelled appointment request from Access to the same individual for the same appointment but for some reason Outlook is not recognising the cancel request as being for the original appointment so when the user (in Outlook) clicks 'remove from calendar' the original appointment is not removed.

Is there something else I need to be sending with the original and cancelled meeting requests?

The code for sending the meeting request is:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdAddAppt_Click()
  2.     On Error GoTo Add_Err
  3.  
  4.     If Me!TutorID = 3 Then
  5.         MsgBox ("There is no tutor selected to send" & Chr(10) _
  6.             & "a meeting meeting request")
  7.         Exit Sub
  8.     End If
  9.  
  10.     'Exit the procedure if appointment has been added to Outlook.
  11.     If Me!ApptmentAdded = True Then
  12.         MsgBox "This appointment is already added to Microsoft Outlook"
  13.         Exit Sub
  14.     'Add a new appointment.
  15.     Else
  16.         Dim objOutlook As Outlook.Application
  17.         Dim objAppt As Outlook.AppointmentItem
  18.         Dim objDuration As Integer
  19.         Dim objOutlookRecip As Outlook.Recipient
  20.         Set objOutlook = CreateObject("Outlook.Application")
  21.         Set objAppt = objOutlook.CreateItem(olAppointmentItem)
  22.         objAppt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
  23.  
  24.         Dim aTemp As Long
  25.         Dim bTemp As Long
  26.         Dim cTemp As Integer
  27.         aTemp = Round((Int(CSng(Me!TimeTo) * 1440)) / 5, 0) * 5
  28.         bTemp = Round((Int(CSng(Me!TimeFrom) * 1440)) / 5, 0) * 5
  29.         cTemp = aTemp - bTemp
  30.  
  31.         Dim objMessage As String
  32.         Dim strRecip As String
  33.         Dim strSelfLead As String
  34.  
  35.         strRecip = Me![Tutor Email Address]
  36.         objMessage = "Teaching booking - " & Me![Programme Name] & ", " & Me![Name of Hirer]
  37.         If Me![Self Lead] = -1 Then
  38.             strSelfLead = "Yes"
  39.         Else
  40.             strSelfLead = "No"
  41.         End If
  42.  
  43.         With objAppt
  44.             Set objOutlookRecip = .Recipients.Add(strRecip)
  45.                 objOutlookRecip.Type = olTo
  46.             .Start = Me![Visit Date] & " " & Me!TimeFrom
  47.             .Duration = cTemp
  48.             .Subject = objMessage
  49.             .ReminderMinutesBeforeStart = 15
  50.             .ReminderSet = True
  51.             .Body = "Number of Students: " & Me![Student Total] & vbCrLf _
  52.                 & "Number of Adults: " & Me![Adult Total] & vbCrLf _
  53.                 & "Self Lead?: " & strSelfLead & vbCrLf _
  54.                 & "Level: " & Me!Level
  55.             .Location = Me!Venue
  56.             .Send
  57.         End With
  58.         'Release the AppointmentItem object variable.
  59.     End If
  60.  
  61.     'Release the Outlook object variable.
  62.     Set objAppt = Nothing
  63.     Set objOutlook = Nothing
  64.     Set objOutlookRecip = Nothing
  65.  
  66.     'Set the AddedToOutlook flag, save the record, display a message.
  67.     Me!ApptmentAdded = True
  68.     DoCmd.RunCommand acCmdSaveRecord
  69.     MsgBox "Appointment Added!"
  70.     Exit Sub
  71.  
  72. Add_Err:
  73.     MsgBox "Error " & Err.Number & vbCrLf & Err.Description
  74.     Exit Sub
  75.  
  76. End Sub
Oct 11 '07 #1
Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
I guess you need to try to Find the appointment based on your data and then issue the delete.
This link might hold additional information:
http://www.mombu.com/microsoft/outlo...ry-937160.html

Nic;o)
Oct 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.