hatte dieses Anliegen schonmal hier dargestellt. Vielleicht kann mir ja jetzt jemad weiterhelfen. Wäre sehr dankbar.
Habe hier ein Makro, welches ich noch etwas verändern möchte:
1. Ich möchte nicht nach einem Datum, sondern nach einem Betreff gefragt werden und
2. ich möchte gerne nicht die letzte, sondern die oberste Zeile aus dem Textfeld eines Termins (Kalender) auslesen.
Was (und wo) muss ich hierfür im Code etwas verändern?
Sub OutlookTerminEinlesen()
Dim outl, Datum As Long, lstrText As String, lbZaehler As Byte, liDurchlauf As Integer
Dim ns, terminOrdner, termine, termin As AppointmentItem
Set outl = CreateObject("Outlook.Application")
Set ns = outl.GetNamespace("MAPI")
Set terminOrdner = ns.GetDefaultFolder(9) 'olFolderCalendar
'Filtere Termine dieses Tages
Datum = Range("A1")
If Datum = 0 Then MsgBox "In A1 muss ein Datum stehen": Exit Sub
Set termine = terminOrdner.Items.Restrict("[Start] >= '" & Format(Datum, "mm""/""dd""/"" _
yyyy
hh:nn")
& "' and [Start] "" Then Range(Range("A6"), Range("A6").End(xlDown)).EntireRow.Delete
For Each termin In termine
ActiveCell = termin.Subject
ActiveCell.Offset(0, 1) = termin.Start
ActiveCell.Offset(0, 2) = termin.End
lstrText = termin.Body
If Right(lstrText, 1) = Chr(10) Then
For liDurchlauf = Len(lstrText) To 1 Step -1
If Asc(Mid(lstrText, liDurchlauf, 1)) = 10 Then
lbZaehler = lbZaehler + 1
End If
If lbZaehler = 2 Then
lstrText = Right(lstrText, Len(lstrText) - liDurchlauf)
lstrText = Left(lstrText, Len(lstrText) - 2)
ActiveCell.Offset(0, 3) = lstrText
lbZaehler = 0
Exit For
End If
Next
Else
For liDurchlauf = Len(lstrText) To 1 Step -1
If Asc(Mid(lstrText, liDurchlauf, 1)) = 10 Then
ActiveCell.Offset(0, 3) = Right(lstrText, Len(lstrText) - liDurchlauf)
Exit For
End If
Next
End If
ActiveCell.Offset(1, 0).Activate
Next termin
End Sub
Vielen Dank schonmal
LG Melek