Solved

onclick of a label to open like mailto in web

Posted on 2004-04-15
10
283 Views
Last Modified: 2010-05-02
Hi,
  Please help me to simulate "mailto" in web action, to onclick of a label in VB. And onclick of a web address label in Vb to open webaddress in IE.

Thanks and Regards,
Nabeel.
 
0
Comment
Question by:nabeelkp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
10 Comments
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 300 total points
ID: 10831621
http://vbnet.mvps.org/code/intrinsic/sehyperlink.htm
then just change this:

Text1.Text = "http://vbnet.mvps.org/"

to

Text1.Text = "mailto:user@domain.com"
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 10831628
Here is another example:

Put a Hyperlink on a Form
http://www.freevbcode.com/ShowCode.Asp?ID=3016

cheers
0
 
LVL 9

Expert Comment

by:p_sie
ID: 10834764
Use the shellexecute API
I don't know the exact phrase right now, cause I am not behind my VB-computer... sorry for that, but
try something like below

in module

Public Function ShellExecute .... (You can find this using the API-viewer)

Sub label1_click()

Shellexecute ... "open", label1.caption , ....

End sub
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 52

Expert Comment

by:Ryan Chong
ID: 10835515
>>You can find this using the API-viewer
Try download it or view it online at www.allapi.net

cheers
0
 

Author Comment

by:nabeelkp
ID: 10847964
Hi,
  I am using VB6 and tried

ShellExecute Me.hWnd, "open", "http://www.yahoo.com", vbNullString, "", 0

But it doesn't work out for me. Please help me to solve this.

Nabeel.
0
 

Author Comment

by:nabeelkp
ID: 10847977
Hi,
  ShellExecute Me.hWnd, "open", "mailto:myemail@myweb.com", vbNullString, "", 0
It works for "mailto" action, but it doesn't work for "http", what could be the reason.

0
 
LVL 9

Expert Comment

by:p_sie
ID: 10848399
The http works for me, so don't know what is happening, maybe remove the http, then it also works
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question