Solved

onclick of a label to open like mailto in web

Posted on 2004-04-15
10
281 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
  • 3
  • 2
  • 2
10 Comments
 
LVL 51

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 51

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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 51

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

830 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