AW: mail bei klick
22.04.2007 20:58:00
Max
Hallo Josef,
danke erstmal für den Tip. Habs gleich ausprobiert. Und zwar mit dem Code:
Sub Mail_small_Text_Outlook()
' Is working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
On Error Resume Next
With OutMail
.To = "ron@debruin.nl"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
bei mir kommt dann aber ne fehlermeldung und ich weiss jetzt nicht ob die kommt weil ich kein outlook drauf hab oder weil was noch nicht richtig ist. auf den rechnern wo es laufen soll ist aber ganz sicher outlook drauf.
er sagt mir Laufzeitfehler 429 - Objekterstellung durch ActiveX-Komponente nicht möglich. Wenn ich auf DEBUGGEN klicke, dann komm ich an die Zeile mit: Set OutApp = CreateObject("Outlook.Application")
kannst mir sagen wo der fehler liegt? und wie mach ich, dass der einfach nix macht wenns n fehler gibt?
also am besten insegesamt bei der gesamten datei... wenn irgendein fehler is am besten einfach nix machen oder so...
danke!!!