|
-
Aug 14th, 2007, 08:13 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Hyperlink text
I have searched the forum and havent found my answer so I am posting it here.
On a form just like a website where you have the text which is hyperlinked, id like to have some text which is hyperlinked to an email address, can someone provide an example please?
Thank you.
-
Aug 14th, 2007, 08:32 AM
#2
Re: Hyperlink text
And, when the email address is clicked, what would happen?
Would you want that email address to be auto populated on the To: line of your default mail service?
-
Aug 14th, 2007, 08:38 AM
#3
Thread Starter
Hyperactive Member
Re: Hyperlink text
errr please explain? Basically if a user clicks an email link then there email client will load pointing to the to: yes. Hopefully this isnt confusing.
-
Aug 14th, 2007, 08:54 AM
#4
Re: Hyperlink text
Presuming you are using a Label. If not, change accordingly
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
Private Const SW_SHOWNORMAL = 1
Private Sub Label1_Click()
Dim MailMe As String
MailMe = "mailto:" & Label1.Caption
ShellExecute Me.hWnd, "open", MailMe, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
-
Aug 14th, 2007, 09:09 AM
#5
Thread Starter
Hyperactive Member
Re: Hyperlink text
ok added:
Code:
Private Sub Label1_Click()
Dim MailMe As String
MailMe = "mailto:[email protected]" & Label1.Caption
ShellExecute Me.hWnd, "open", MailMe, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
When u click the label the email opens up but on the end of the email addy is the name of what I call the Label, which will cease to operate the email address.
Any way around this?
-
Aug 14th, 2007, 09:22 AM
#6
Thread Starter
Hyperactive Member
Re: Hyperlink text
Thank you. Worked it out removing the label and caption. Much appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|