Microsoft Office Tutorials and References
In Depth Information
Creating Reminders Automatically
ByVal lFlags As Long) As Long¶
Private Declare Function InternetCloseHandle _¶
Lib "wininet" (ByVal hInet As Long) As Integer¶
Public Sub CreateAuctionReminder()¶
'Outlook Task object declaration¶
Dim objTask As Outlook.TaskItem¶
'variable declaration¶
Dim strHTML As String 'HTML code variable¶
Dim URL As String 'URL address variable¶
Dim aucNum As String 'ebay Auction number¶
Dim strEnding As String 'Auction Ending Date¶
Dim strItem As String 'Item name¶
Dim EndTime As String 'Ending time of auction¶
Dim dt As Variant 'Date¶
'Request Auction ID¶
aucNum = InputBox("Please enter Auction Number", _¶
"Auction Number")¶
'Verify Auction ID and stop process if¶
'something is wrong¶
If IsNull(aucNum) Or Trim(aucNum) = "" Then Exit Sub¶
If Not IsNumeric(aucNum) Then¶
MsgBox "Invalid Auction Number.", _¶
vbOKOnly + vbExclamation, "Error"¶
Exit Sub¶
End If¶
On Error GoTo ErrHandler¶
'Web Site URL for requested item listing¶
URL = "" & _¶
"ViewItem&item=" & aucNum¶
'Retrieve HTML code of given web page¶
strHTML = GetHTMLCode(URL)¶
'If returned HTML code is empty then exit application¶
If Trim(strHTML) = "" Then¶
MsgBox "The page cannot be displayed. Please check " & _¶
"the URL you entered.", _¶
vbOKOnly + vbExclamation, _¶
"The page cannot be displayed"¶
Exit Sub¶
End If¶
'Retrieve title of web page¶
strHTML = Mid(strHTML, _¶
InStr(1, strHTML, "<title>", vbTextCompare), _¶
InStr(1, strHTML, "</title>", vbTextCompare) _¶
- InStr(1, strHTML, "<title>", vbTextCompare))¶
'Find ending time from the title¶
'Currently ebay web page returns this information in title¶
'eBay item <aucNum> (Ends <ending time>) - Item Description¶
'All that is required is to parse this string¶
strHTML = Right(strHTML, _¶
Len(strHTML) - InStr(strHTML, "Ends") - 4)¶
Search JabSto ::

Custom Search