error 1041 line 1246 col 41 Expected "end" I highlighted col 41 in
Red. anybody who can check this out, I am lost at this stuff.Thanks [
![Cheesy :D](http://www.ultrahal.com/community/Smileys/default/cheesy.gif)
][?]
SearchWeek = 0
WeekLoc = InStr(1, ApptSentence, "sunday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbSunday
If SearchWeek = 0 Then
WeekLoc = InStr(1, ApptSentence, "monday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbMonday
End If
If SearchWeek = 0 Then
WeekLoc = InStr(1, ApptSentence, "tuesday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbTuesday
End If
If SearchWeek = 0 Then
WeekLoc = InStr(1, ApptSentence, "wednesday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbWednesday
End If
If SearchWeek = 0 Then
WeekLoc = InStr(1, ApptSentence, "thursday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbThursday
End If
If SearchWeek = 0 Then
WeekLoc = InStr(1, ApptSentence, "friday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbFriday
End If
If SearchWeek = 0 Then
WeekLoc = InStr(1, ApptSentence, "saturday", vbTextCompare)
If WeekLoc > 0 Then SearchWeek = vbSaturday
End If
If SearchWeek > 0 Then
ExtraWeek = 0
If InStr(1, ApptSentence, " next ", vbTextCompare) Then ExtraWeek = 7
If InStr(1, ApptSentence, " following ", vbTextCompare) Then ExtraWeek = 7
For i = 1 To 7
If Weekday(DateAdd("d", i + ExtraWeek, Date)) = SearchWeek Then
MentionedDate = DateAdd("d", i + ExtraWeek, Date)
OrigPrefix = Trim(Left(ApptSentence, WeekLoc - 1)) & " "
OrigPrefix = Replace
(OrigPrefix, " next ", " ", 1, -1, vbTextCompare)
OrigPrefix = Replace(OrigPrefix, " this ", " ", 1, -1, vbTextCompare)
OrigPrefix = Replace(OrigPrefix, " upcoming ", " ", 1, -1, vbTextCompare)
OrigPrefix = Replace(OrigPrefix, " the following ", " ", 1, -1, vbTextCompare)
OrigPrefix = Replace(OrigPrefix, " following ", " ", 1, -1, vbTextCompare)
OrigPrefix = HalBrain.RemoveExtraSpaces(OrigPrefix)
WeekLoc = InStr(WeekLoc + 1, ApptSentence, " ")
If WeekLoc > 0 Then OrigSuffix = Right(ApptSentence, Len(ApptSentence) - WeekLoc)
End If
Next
End If
End If
'Figure out time
ApptSentence = Trim(ApptSentence) & " "
ColonLoc = InStr(ApptSentence, ":")
MentionedAMPM = ""
If ColonLoc > 0 Then
SpaceLoc = InStrRev(ApptSentence, " ", ColonLoc)
If SpaceLoc > 0 And SpaceLoc < ColonLoc Then
MentionedHour = Mid(ApptSentence, SpaceLoc + 1, ColonLoc - SpaceLoc - 1)
Temp = HalBrain.Word2Num(MentionedHour)
If Temp <> "X" Then
OrigPrefix = Replace(OrigPrefix, MentionedHour & ":", Temp & ":", 1, -1, vbTextCompare)
OrigSuffix = Replace(OrigSuffix, MentionedHour & ":", Temp & ":", 1, -1, vbTextCompare)
MentionedHour = Temp
End If