Option Explicit

'API used to open the hyperlink
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

'local variable(s) to hold property value(s)
Private mstrLinkText As String 'local copy
Private mstrLinkURL As String 'local copy

Public Property Let LinkURL(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.LinkURL = 5
    mstrLinkURL = vData
End Property

Public Property Get LinkURL() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.LinkURL
    LinkURL = mstrLinkURL
End Property

Public Sub OpenLink()
    ShellExecute 0&, "Open", _
     mstrLinkURL, "", "", vbNormalFocus
End Sub

Public Property Let LinkText(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.LinkText = 5
    mstrLinkText = vData
End Property

Public Property Get LinkText() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.LinkText
    LinkText = mstrLinkText
End Property

