G
GSK
I am checking for resource availability and checking for any conflicts with
other meetings.
I want to check on a 30 mins interval. The code below is not working.
iCurrentSlotStart and iCurrentSlotEnd in the below code always returns 0.
Please help to make this work.
Thanks in advance
Regards
Sub CommandButton3_Click()
StartDate = FormatDateTime("11/28/2007 1:30:00 PM")
EndDate = FormatDateTime("11/28/2007 2:30:00 PM")
strFreeBusy =
Item.Recipients(1).FreeBusy(FormatDateTime(StartDate,vbShortDate), 30, False)
oRecipient.resolve
iCurrentSlotStart = Int(DateDiff("n", CDate(StartDate),
CDate(StartDate)) \ 30)
iCurrentSlotEnd = Int(DateDiff("n", CDate(EndDate), CDate(EndDate))
\ 30)
strFreeBusyTemp = Left(strFreeBusy, iCurrentSlotEnd)
strFreeBusyTemp2 = StrReverse(strFreeBusyTemp)
strFreeBusy2 = StrReverse(Left(strFreeBusyTemp2,
Len(strFreeBusyTemp2) - iCurrentSlotStart))
iBusySlot = InStr(1, strFreeBusy2, "1")
If iBusySlot <> 0 Then
Msgbox "Conflict with another meeting"
Exit Sub
End If
End Sub
other meetings.
I want to check on a 30 mins interval. The code below is not working.
iCurrentSlotStart and iCurrentSlotEnd in the below code always returns 0.
Please help to make this work.
Thanks in advance
Regards
Sub CommandButton3_Click()
StartDate = FormatDateTime("11/28/2007 1:30:00 PM")
EndDate = FormatDateTime("11/28/2007 2:30:00 PM")
strFreeBusy =
Item.Recipients(1).FreeBusy(FormatDateTime(StartDate,vbShortDate), 30, False)
oRecipient.resolve
iCurrentSlotStart = Int(DateDiff("n", CDate(StartDate),
CDate(StartDate)) \ 30)
iCurrentSlotEnd = Int(DateDiff("n", CDate(EndDate), CDate(EndDate))
\ 30)
strFreeBusyTemp = Left(strFreeBusy, iCurrentSlotEnd)
strFreeBusyTemp2 = StrReverse(strFreeBusyTemp)
strFreeBusy2 = StrReverse(Left(strFreeBusyTemp2,
Len(strFreeBusyTemp2) - iCurrentSlotStart))
iBusySlot = InStr(1, strFreeBusy2, "1")
If iBusySlot <> 0 Then
Msgbox "Conflict with another meeting"
Exit Sub
End If
End Sub