Hey Leute !
wie schaffe ich es, dass meine Betreffzeile mit mehreren Zellen aus Excel verknüpft wird, anstatt, dass ich den Betreff von vorne rein eingebe? Das Problem ist nämlich, dass sich der Betreff immer wieder ändern soll.
Sub SendDailyMail()
Dim UserName As String
Dim MailDbName As String
Dim Recipient As Variant
Dim Maildb As Object
Dim MailDoc As Object
Dim session As Object
Dim stSignature As String
Dim ritemtext As Object
With Application
.ScreenUpdating = False
.DisplayAlerts = False
AWS = ActiveWorkbook.FullName
Set Worksheet = Application.ActiveWorkbook.Worksheets.Item(1)
Set session = CreateObject("Notes.NotesSession")
Set Maildb = session.CurrentDatabase
Set MailDoc = Maildb.createdocument
MailDoc.Form = "Memo"
Set Workspace = CreateObject("Notes.NOTESUIWORKSPACE")
stSignature = Maildb.GetProfileDocument("CalendarProfile").GetItemValue("Signature")(0)
Recipient = ""
'MailDoc.Display = "Testgruppe"
MailDoc.sendto = "testgruppe"
MailDoc.copyto = ""
MailDoc.subject = ""
MailDoc.SAVEMESSAGEONSEND = saveit
Set ritem = MailDoc.CREATERICHTEXTITEM("Body")
For i = 2 To 2
With ritem
.AppendText ("")
.addnewline (3)
End With
Next
For i = 1 To 41
With ritem
.AppendText ("")
.AppendText (Cells(i, 1).Value & vbTab & Cells(i, 2).Value & vbTab & Cells(i, 3).Value & vbTab & Cells(i, 4).Value & vbTab & Cells(i, 5).Value & vbTab)
.addnewline (1)
End With
Next
For i = 2 To 2
With ritem
.AppendText ("" & vbCrLf & vbCrLf & stSignature)
End With
Next
ritem.Update
Call Workspace.editdocument(True, MailDoc).GOTOFIELD("Body")
MailDoc.PostedDate = Now()
'Call MailDoc.SEND(False)
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachMe = Nothing
Set session = Nothing
.ScreenUpdating = True
.DisplayAlerts = True
End With
Range("a1").Select
End Sub
DANKE FÜR EURE HILFE