Hallo,
ich möchte alle meine Kalendereinträge auslesen und in einer Excel-Datei speichern oder in einer CSV-Datei speichern.
Ich habe bisher entweder die Möglichkeit gehabt, manuell per Export den Kalender als CSV-Datei zu speichern.
Leider ist da nur mein Kalender und komischerweise auch ein Kalender den ein Kollege geteilt hat mit drin, aber nicht alle Kalender die ich in Outlook habe.
Ich habe ein Skript, welches meine Kalendereinträge in eine Excel-Datei einliest, leider nicht die anderen Kalender.
Im Skript habe ich folgendes stehen:
[/font]Ich möchte aber alle Kalender auslesen und in der Tabelle einspeichern und nicht nur den Standardkalender.
Kann Mir da vielleicht Jemand helfen?
~blaze~: Neu formatiert, Thema verschoben
Alter Code
'Durchlaufe alle Termine des aktuellen Standardkalenders
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']i = i + 1[/font]
For Each [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Termin [/font]In [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']olApp.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]Set [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']myTerminPatt = Termin.GetRecurrencePattern[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Format(Termin.Start, "dd.mm.yyyy") >= startDate [/font]And [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Format(Termin.End, "dd.mm.yyyy") <= endDate [/font]Then
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If Not [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Termin.AllDayEvent [/font]Then [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Trag_ein Termin, i, [/font]False
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]End If
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']myTerminPatt.RecurrenceType = olRecursDaily [/font]Then
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Format(myTerminPatt.PatternEndDate, "dd.mm.yyyy") >= startDate [/font]Then
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] Trag_ein_Recurr Termin, i, [/font]False[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'], startDate, endDate[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]End If
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]End If
Next
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Range("C1").Select[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Range("A1:H" & Range("A1").CurrentRegion.Rows.Count).Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess
ich möchte alle meine Kalendereinträge auslesen und in einer Excel-Datei speichern oder in einer CSV-Datei speichern.
Ich habe bisher entweder die Möglichkeit gehabt, manuell per Export den Kalender als CSV-Datei zu speichern.
Leider ist da nur mein Kalender und komischerweise auch ein Kalender den ein Kollege geteilt hat mit drin, aber nicht alle Kalender die ich in Outlook habe.
Ich habe ein Skript, welches meine Kalendereinträge in eine Excel-Datei einliest, leider nicht die anderen Kalender.
Im Skript habe ich folgendes stehen:
Visual Basic-Quellcode
- 'Durchlaufe alle Termine des aktuellen Standardkalenders
- i = i + 1
- For Each Termin In olApp.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
- Set myTerminPatt = Termin.GetRecurrencePattern
- If Format(Termin.Start, "dd.mm.yyyy") >= startDate And Format(Termin.End, "dd.mm.yyyy") <= endDate Then
- If Not Termin.AllDayEvent Then Trag_ein Termin, i, False
- End If
- If myTerminPatt.RecurrenceType = olRecursDaily Then
- If Format(myTerminPatt.PatternEndDate, "dd.mm.yyyy") >= startDate Then
- Trag_ein_Recurr Termin, i, False, startDate, endDate
- End If
- End If
- Next
- Range("C1").Select
- Range("A1:H" & Range("A1").CurrentRegion.Rows.Count).Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess
[/font]Ich möchte aber alle Kalender auslesen und in der Tabelle einspeichern und nicht nur den Standardkalender.
Kann Mir da vielleicht Jemand helfen?

~blaze~: Neu formatiert, Thema verschoben
'Durchlaufe alle Termine des aktuellen Standardkalenders
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']i = i + 1[/font]
For Each [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Termin [/font]In [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']olApp.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]Set [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']myTerminPatt = Termin.GetRecurrencePattern[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Format(Termin.Start, "dd.mm.yyyy") >= startDate [/font]And [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Format(Termin.End, "dd.mm.yyyy") <= endDate [/font]Then
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If Not [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Termin.AllDayEvent [/font]Then [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Trag_ein Termin, i, [/font]False
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]End If
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']myTerminPatt.RecurrenceType = olRecursDaily [/font]Then
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]If [font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Format(myTerminPatt.PatternEndDate, "dd.mm.yyyy") >= startDate [/font]Then
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] Trag_ein_Recurr Termin, i, [/font]False[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'], startDate, endDate[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]End If
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)'] [/font]End If
Next
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Range("C1").Select[/font]
[font='Arial, FixedSys; font-size: small; background-color: rgb(204, 204, 204)']Range("A1:H" & Range("A1").CurrentRegion.Rows.Count).Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „~blaze~“ ()