by Anonymous (267 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Fri 1st October 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Create an Internet shortcut
'Here is an example...
CreateInternetShortCut "C:\windows\desktop\test.url", "http://www.vbcode.com"
Sub CreateInternetShortCut(URLFile As String, URLTarget As String)
'An Internet Shortcut takes on the form of
' [InternetShortcut]
' URL=http://www.YourWebSiteAddress.com
Dim intFreeFile As Integer
'get free file number
intFreeFile = FreeFile
'print the URL file
Open URLFile For Output As intFreeFile
Print #intFreeFile, "[InternetShortcut]"
Print #intFreeFile, "URL=" & URLTarget
Close intFreeFile
End Sub