Gruppe
Extern
Problem
Wie kann ich aus Excel heraus das Email-Programm starten und Email-Adresse, Betreff sowie den Text vorgeben?
StandardModule: basMain
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 Sub Mail(sAdr As String, Optional sSub As String, _
Optional sBody As String)
Call ShellExecute(0&, "Open", "mailto:" + sAdr + _
"?Subject=" + sSub + "&Body=" + sBody, "", "", 1)
End Sub
Sub MailVersenden()
Dim sAddress As String, sSubject As String, sTxt As String
sAddress = Range("B1").Value
sSubject = Range("B2").Value
sTxt = Range("B3").Value
Call Mail(sAddress, sSubject, sTxt)
End Sub