-
Private Sub opt5_Click()
On Error GoTo EmailError
Success = ShellExecute(0&, vbNullString, "mailto:[email protected]", vbNullString, "C:\", 1)
Exit Sub
EmailError:
MsgBox "There was an unexpected error while trying to initialise your email facilities. This may be because your computer does not have email facilities, or it may be because of a faulty installation."
End Sub
When I try to use this, I get a compile error that highlights ShellExecute in the 3rd line.
What do I need to do to get this to work?
-
-
[/code]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[/code]
Put this in a module.
-
email
'launch default email program and send mail
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
Private Const SW_SHOW = 5
'form code
ShellExecute hwnd, "open", "mailto:[email protected]", vbNullString, vbNullString, SW_SHOW
-
OH MY GOD!!!!!
HeSaidJoe,
It worked!!!!! I finally figured out what you mean't and put it in. Yippee!!!!!!!!
Thanks more than you know.....
Jim