VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Create Email in default client / Open URL

by John 'Hemo' Hiemenz ()
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Simple calls to open up the default web browser to a given URL or to create an email message in the default email client.

Inputs
' To open a URL - Specify the URL ' OpenInternet Me, "http://www.search.com", Normal ' ' Specify Email Address and Subject ' OpenInternet Me, _ ' "mailto:[email protected]?SUBJECT=Hello World", Normal
Assumes
' I am NOT the original author of this code, but posting ' it because I haven't found this type of implementation ' here yet.
Side Effects
' Does not send the Email message - up to you to do that
API Declarations
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
Public Enum T_WindowStyle
Maximized = 3
Normal = 1
ShowOnly = 5
End Enum

Rate Create Email in default client / Open URL

Public Sub OpenInternet(Parent As Form, URL As String, _
            WindowStyle As T_WindowStyle)
ShellExecute Parent.hwnd, "Open", URL, "", "", WindowStyle
End Sub 

Download this snippet    Add to My Saved Code

Create Email in default client / Open URL Comments

No comments have been posted about Create Email in default client / Open URL. Why not be the first to post a comment about Create Email in default client / Open URL.

Post your comment

Subject:
Message:
0/1000 characters