Gruppe
API
Problem
Aus einer UserForm soll auf SchaltflächenKlick Outlook mit dem Mail-Dialog aufgerufen werden.
ClassModule: frmMail
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdMail_Click()
Call CallMail("hans@herber.de")
End Sub
StandardModule: Modul1
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
Sub CallMail( _
eMail As String)
Call ShellExecute(0&, "Open", "mailto:" + eMail, "", "", 1)
End Sub
Sub CallForm()
frmMail.Show
End Sub