The IsURL Method

Use the IsURL method to determine if a string is a properly formed URL. It does not ensure that the URL is actually accessible, just that it is syntactically correct. It returns a Boolean. Its syntax is as follows:

blnStatus = UtilityObject.IsURL(InputURL)

This method has one parameter, InputURL, a string. Use it to specify the URL to check for validity.

This example gets a string from the user and then, using IsURL, displays whether it is a valid URL:

Public Sub TestIsURL() Dim strInput As String

With ThisDrawing.Utility strInput = .GetString(True, vbCr & "Enter a URL: ") If .IsURL(strInput) Then

MsgBox "You entered a valid URL"


MsgBox "That was not a URL" End If End With End Sub

0 0

Post a comment