Solved

onclick of a label to open like mailto in web

Posted on 2004-04-15
10
284 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
Industry Leaders: 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!

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

705 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