-
E-mail Link
Sups,
In my program, the user can enter an e-mail address. What I want to do is to make the user to be able, after typing the e-mail, to click on the e-mail address and the default e-mail program will launch with the e-mail (Just like e-mail link in IE)
Also I want to do the same in site address, So when clickin the link, the default browser will open, surfing to that address.
tnx
-
use this:
Public 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
for hyperlink:
ShellExecute Me.hWnd,"Open","http://www.cnn.com",0,0,3
for e-mail:
ShellExecute Me.hWnd,"Open","mailto:[email protected]",0,0,3
-
That worked great for me, but do you know if there is a parameter that you can send so that the browser (i'm opening a web site, not email) will open the link in a new window even if there are already open browser windows?
Thanks!
Jeff
-
Detect the default browser and shell it (to be sure that a new window is opened). Then, use the code provided here.
-