Not a Member Yet,
Click here to Register

ID: 364
Viewed: 2803
Added: Aug 19, 2002
Version:
Snippet uploaded by: snippet
Written By: Clint LaFever
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

------------------------------------------------------------
' Author: Clint LaFever [lafeverc@usa.net]
' Purpose: CHyperlink Class is used to launch any associated file on the system.
------------------------------------------------------------

Class which allows the launching of any file with it`s associated program. Most commonly used to pass a URL or mailto tag to launch the users default browser or email client hence the class name. Remember, this can also be used to launch .DOC, .XLS, or any other registered known file type.

Example:
Dim obj as New CHTML obj.ExecuteLink "http://codedepot.iscool.net"
or
obj.ExecuteLink "mailto:lafeverc@home.com?subject=Sample%20Message"
or
obj.ExecuteLink App.Path & "\SomeDocument.DOC"

Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
Option Explicit 
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

Const SW_SHOWNORMAL = 1
Public Link As String
Public Sub ExecuteLink(Optional pstrLINK As String = "")
On Error Resume Next
Dim lRet As Long
If pstrLINK <> "" Then Link = pstrLINK
If Link <> "" Then
lRet = ShellExecute(0, "open", Link, "", App.Path, SW_SHOWNORMAL)
If lRet >= 0 And lRet <= 32 Then MsgBox "Error jumping to:" & Link, 48, "Warning"
End If
End If
End Sub
;


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!