Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1450
  • Last Modified:

Check if appointment already exists

I have created a addin which downloads a series of events from a php webservice and then adds them to the outlook calendar.

I know have a requirement to check if the appointment\event exists before te insert happens. this is to prevent duplicates of the same appointment.

I also need the abiity to change the appointment if the times have changed. Is there anyway of storing a ID number in the appointment.

Many thanks for any help. The code i am using to create the appointment is below.
Private Sub Btn2_Click(ByVal ctrl As Office.CommandBarButton, ByRef cancelDefault As Boolean) Handles btn1.Click
        Dim service As New wsclick.webservice
        Dim events As Array
        Dim uc As New wsclick.userCredentials
        uc.username = My.Settings.uname
        uc.password = My.Settings.pwd
        uc.database = My.Settings.db
        events = service.getEvents(uc)
 
        For Each cevent As wsclick.Event In events
 
 
 
            createEvents(cevent.subject, cevent.startdate, cevent.enddate, cevent.allday, cevent.description, cevent.timezone, cevent.remind, cevent.recurrenceperiod, cevent.recurrenceenddate, cevent.recurrenceoccurrences)
 
        Next
 
 
        MessageBox.Show("You have succesfully synchronised")
 
 
    End Sub
 
    
     Sub createEvents(ByVal subject As String, ByVal startdate As String, ByVal enddate As String, ByVal allday As String, ByVal description As String, ByVal timezone As String, ByVal remind As String, ByVal reccurrenceperiod As String, ByVal recurrencedate As String, ByVal recurrenceoccurencies As String)
 
 
        Dim oevent As Outlook.AppointmentItem = oapp.CreateItem(Outlook.OlItemType.olAppointmentItem)
        With oevent
            .Subject = subject
            .Start = CType(startdate, DateTime)
            .End = CType(enddate, DateTime)
            
            .Save()
        End With
    End Sub

Open in new window

0
mm72
Asked:
mm72
1 Solution
 
tbsgadiCommented:
0
 
mm72Author Commented:
Thanks guys i managed to get it to work after reading the post listed

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now