Re: Mailversand mit Outlook funktioniert nicht
Verfasst: Sa, 17.01.2009 19:07
Hi, wo dein Fehler liegt, weiß ich nicht, aber dieser Code funktioniert :
Funktioniert jedenfalls mit 3.0 und vista
lg Andreas
Code: Alles auswählen
Dim oOLEService
Dim oOutlookApp
Dim oOutlookMail
oOLEService = createUnoService("com.sun.star.bridge.OleObjectFactory")
oOutlookApp = oOLEService.createInstance("Outlook.Application")
oOutlookMail = oOutlookApp.CreateItem(0)
'------------------------------------------------------------------------------------------------------
Anrede = "Sehr geehrte Damen und Herren,"
'------------------------------------------------------------------------------------------------------
bodytext = " dies ist ein test"
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
Signatur = "Mit freundlichen Grüßen "
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
MailKoerper = Anrede & bodytext & Signatur
'------------------------------------------------------------------------------------------------------
anstring = "BlaBla@BlaBla.de"
copystring = "ich@meins.de"
subjecttext = " betr.: testversuch"
with oOutlookMail
.To = anstring
.CC = copystring
.Subject = subjecttext
.HTMLBody = MailKoerper
'.Attachments.Add("C:\foo.txt")
.Display()
'.send()
end with
lg Andreas