HiperLink



Option Explicit
'Function needed to launch the browser


Private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" ( ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

'Window constants for the API

Const SW_SHOWMAXIMIZED = 3
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWNORMAL = 1

'Local variables

Private mstrURL As String
Private mlngMax As Long
Private mlngMin As Long
Private mlngNormal As Long

Property Let URL(strURL As String)
mstrURL = strURL
End Property

Property Let Maximized(bMax As Boolean)
If bMax Then
mlngMax = SW_SHOWMAXIMIZED
End If
End Property

Property Let Minimized(bMin As Boolean)
If bMin Then
mlngMin = SW_SHOWMINIMIZED
End If
End Property

Property Let Normal(bNormal As Boolean)
If bNormal Then
mlngNormal = SW_SHOWNORMAL
End If
End Property

Public Sub OpenURL()
Call ShellExecute(0&, vbNullString, mstrURL, _
vbNullString, "C:\", mlngMax Or mlngMin Or mlngNormal)
End Sub

Public Sub Mail()
Call ShellExecute(0&, vbNullString, "mailto:" & mstrURL, _
vbNullString, "C:\", mlngMax Or mlngMin Or mlngNormal)
End Sub

(hiperlink.html)- by Paolo Puglisi - Modifica del 25/3/2019