Hallo,
in einem code öffne ich Outlook und bearbeite die mail.
....
Set OMail = oApp.CreateItem(0)
With OMail
Set .SendUsingAccount = .Session.Accounts.Item(1)
Set oOLRecip = .Recipients.Add(sRec)
.Subject = sSub
.cc = "marielmht@ymail.com"
.GetInspector.Display
strSignatur = .HTMLBody
.HTMLBody = "<p><font face=""Calibri"" size=""18""></font></p>" _
& sBody & "<br>" & strT1 & "<br>" & strSignatur
If Application.CountIf(Range(Cells(2, 1), Cells(iRow, 1)), Cells(iCounter, 1)) = 1 Then
Set oOLAttach = .Attachments.Add(sFile)
Else
betrag = Cells(iCounter, 6)
Anz = Application.CountIf(Range(Cells(2, 1), Cells(iRow, 1)), Cells(iCounter, 1))
Set Rng = Columns(1).Find(what:=Cells(iCounter, 1), lookat:=xlWhole, LookIn:=xlValues)
rRow = Rng.Row
sFile = Cells(rRow, 2)
Set oOLAttach = .Attachments.Add(sFile)
k = 1
While k <= Anz - 1
Set Rng = Columns(1).FindNext(Rng)
rRow = Rng.Row
sFile = Cells(rRow, 2)
Set oOLAttach = .Attachments.Add(sFile)
betrag = betrag + Cells(rRow, 6)
k = k + 1
Wend
Set oOLAttach = .Attachments.Add("C:\Users\User\Documents\at 2022.pdf")
.Send
Ich möchte gern noch eine 3x3Tabelle in die mail einfügen und die entsprechenden Tabellenfelder mit Daten füllen. Weiß jemand, wie das geht?
Danke für euren Tipp.
Gruß A.