[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • 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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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