Microsoft Office Tutorials and References
In Depth Information
Creating Reminders Automatically
'Retrieve ending time from the title¶
strEnding = Left(strHTML, InStr(strHTML, ")") - 5)¶
dt = strEnding¶
strEnding = Replace(Left(dt, InStrRev(dt, " ") - 1), _¶
Chr(13) & Chr(10), "")¶
'Verify if retrieved data is a valid date¶
If Not IsDate(strEnding) Then Exit Sub¶
'Format retrieved date in more readable format¶
strEnding = Format(dt, "mm/dd/yyyy hh:mm AM/PM")¶
'Retrieve item name¶
strItem = Replace(Right(strHTML, Len(strHTML) _¶
- InStr(strHTML, ")") - 1), _¶
Chr(13) & Chr(10), "")¶
'Create new task item for this item¶
Set objTask = Application.CreateItem(olTaskItem)¶
With objTask¶
.StartDate = strEnding¶
.DueDate = strEnding¶
.Subject = aucNum & strItem¶
.ReminderSet = True¶
.ReminderOverrideDefault = True¶
.ReminderPlaySound = True¶
'Set reminder time for 5 minutes before¶
'Auction ending¶
.ReminderTime = Format(DateValue(dt) & " " & _¶
TimeSerial(Hour(strEnding), Minute(strEnding) - 5, 0), _¶
"mm/dd/yyyy HH:MM AM/PM")¶
'Auction information¶
.Body = "Reminder for " & strItem & vbCrLf & _¶
"Auction Number : " & aucNum & vbCrLf & _¶
"Ends : " & strEnding¶
.Save¶
End With¶
ExitSub:¶
Exit Sub¶
ErrHandler:¶
'Critical Error¶
MsgBox "Cannot parse related html page. " & _¶
"May be wrong Auction Number", _¶
vbOKOnly + vbExclamation, "Error"¶
GoTo ExitSub¶
End Sub¶
' * * * * *¶
Private Function GetHTMLCode(ByVal strURL As String) _¶
As String¶
'Variable declaration¶
Dim tmpHTML As String¶
Dim strHTML As String¶
Dim strTemp As String¶
Dim i As Integer¶
Out
Search JabSto ::




Custom Search