Microsoft Office Tutorials and References
In Depth Information
Creating Reminders Automatically
'Retrieve current temporary system folder path¶
strTemp = Space$(256)¶
Call GetTempPath(Len(strTemp), strTemp)¶
'Remove unwanted chars from the path variable¶
i = InStr(strTemp, Chr$(0))¶
If i Then¶
strTemp = Left$(strTemp, i - 1)¶
End If¶
'Create temporary html file in local computer¶
'(in previously retrieved temporary folder)¶
'Use a unique name by current time¶
tmpHTML = strTemp & "webpageemail" & _¶
Format(Now, "mmddyyhhmm") & ".html"¶
Call SaveTmpFile(strURL, tmpHTML)¶
'Retrieve HTML code from saved file¶
Open tmpHTML For Binary As #1¶
strHTML = Space(LOF(1))¶
Get #1, , strHTML¶
Close #1¶
'Delete temporary HTML file¶
Kill tmpHTML¶
'Return HTML code¶
GetHTMLCode = strHTML¶
End Function¶
' * * * * *¶
Private Function SaveTmpFile(strURL As String, _¶
tmpHTML As String) As Boolean¶
'API function variables declaration¶
Dim lngret As Long¶
Dim lngInet As Long¶
Dim hInet¶
'Open web page and save its HTML code into the¶
'given temporary HTML file¶
If lngInet = 0 Then hInet = InternetOpen("", 1, _¶
vbNullString, vbNullString, 0)¶
'Download web page source code as HTML¶
lngret = URLDownloadToFile(0, strURL, tmpHTML, 0, 0)¶
'Close internet connection¶
InternetCloseHandle lngInet¶
End Function¶
EBay auctions have been used as sample data. The user simply enters an
auction number that is listed on eBay and the application returns the
necessary information for the item and sets a reminder five minutes before the
ending time of the selected auction.
Note: EBay often changes their web layout, which could make this macro worthless
as it is written, making adjustments necessary.
Search JabSto ::

Custom Search