Opens and returns the document or file at the specified URL.
object.OpenURL( URL [,FileName] ) |
- URL
- Required. A String that specifies the URL.
- FileName
- Optional. A String that specifies the target file.
Variant
When the FileName argument is included, OpenURL will download the contents of the target URL to the specified file. The return value of OpenURL is the name of the specified file (success) or an empty string (failure).
When the FileName argument is omitted, OpenURL returns the text contents of the target URL as a string.
Opens a URL and displays the results in a message box.
INET Example (VBScript) | ![]() |
---|---|
Sub OpenESRI Dim objNet, strURL, varData Set objNet = Application.CreateAppObject("INET") strURL = "http://www.esri.com" 'Display the host name in a message box MsgBox objNet.HostName, vbOKOnly, "HostName" varData = objNet.OpenURL(strURL) 'Display the data in a message box. MsgBox varData, vbOKOnly, strURL Set objNet = Nothing End Sub |