• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 416
  • Last Modified:

Launch default email app in vb6

Need a clean, easy way to do this.
0
robbperk
Asked:
robbperk
  • 2
1 Solution
 
aspirineCommented:
First declare the shellexecute api like this:

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

Then in your code, insert something like:
ShellExecute 0&, vbNullString, "mailto:your@email.com", vbNullString, vbNullString, SW_SHOWNORMAL

I hope this is what you wanted
0
 
robbperkAuthor Commented:
Received error on SW-SHOWNORMAL
0
 
aspirineCommented:
oops, sorry, forgot about that constant, add this to your code:

Private Const SW_SHOWNORMAL = 1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now