title image


Smiley Re: E-Mail senden über VBA ??
Hallo Claudia, damit muesstest Du zum Ziel kommen koennen:Option Explicit 'Forces that all variables are declared.Const MyApplication As String = "Mein Makro"' API-declaration to send an e-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 LongPrivate Sub EmailCreate(EmailAddress As String, Optional EmailSubject As String, Optional EmailBody As String) Call ShellExecute(0&, "Open", "mailto:" + EmailAddress + "?Subject=" + EmailSubject + "&Body=" + EmailBody, "", "", 1)End SubPrivate Sub ButtonSendEmail_Click() Dim strEmailAddress As String Dim strEmailSubject As String Dim strEmailBody As String Dim blnEmailOK As Boolean On Error GoTo ErrorHandle strEmailAddress = Trim(Me.TextBox1.Text) strEmailSubject = "Re: " & MyApplication strEmailBody = "Ich habe ein paar Fragen ..." blnEmailOK = False If InStr(strEmailAddress, "@") > 0 Then blnEmailOK = True End If If blnEmailOK Then Call EmailCreate(strEmailAddress, strEmailSubject, strEmailBody) Else GoTo ErrorHandle End If Me.Hide Exit SubErrorHandle: MsgBox "Eine E-Mail an die Adresse " & vbCrLf & vbCrLf & _ vbTab & strEmailAddress & vbCrLf & vbCrLf & _ "kann leider NICHT automatisch erzeugt werden."End SubPrivate Sub UserForm_Initialize() Me.TextBox1 = "norbert-koehler@gmx.de "End SubViele GruesseNorbert

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: