Outlook über Excel?!
10.03.2004 15:31:18
Andre
Folgender Code funktioniert auf meinem Rechner, das Problem ist, auf einem anderen wieder nicht! Hat jemand ´ne Idee, woran´s liegen könnte?
Sub Outlook_Senden()
Dim Nachricht As Object, OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim AWS As String, Adresse As String
strName = "Test "
strPfad = [Kontrolle!K27] & "\"
AWS = strPfad & strName & Format(date, "ddmmyy") & ".txt"
InitializeOutlook = True
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
.To = [Kontrolle!K26]
.Subject = "test"
.Body = "test"
.attachments.Add AWS
.Send
End With
Adresse = [Kontrolle!K26]
OutApp.Quit
MsgBox ("Daten an Adresse: " & Adresse & " gesendet!")
Set OutApp = Nothing
Set Nachricht = Nothing
End Sub
Offensichtlich funktioniert die Zeile "Set Nachricht = OutApp.CreateItem(0)" nicht, Set Nachricht = "" wird angezeigt, aber warum?! Ist vielleicht eine Einstellung von Outlook daran Schuld, bis jetzt konnte ich nichts finden!
Gruß Andre