Ich hätte da 'nur' VB im Angebot:
Spoiler anzeigen
Code
Imports Outlook = Microsoft.Office.Interop.Outlook
Public Class CalReader
Dim objOL As Outlook.Application = New Outlook.Application
Dim objNS = objOL.GetNamespace("MAPI")
Sub KalenderLesen(Rcpnt As String)
Dim myRecipient As Outlook.Recipient = objNS.createrecipient(Rcpnt)
myRecipient.Resolve()
Dim SharedFolder As Folder
Dim Termine As New List(Of Outlook.AppointmentItem)
If myRecipient.Resolved Then
SharedFolder = objNS.GetSharedDefaultFolder(myRecipient, 9) ' 9 = Kalenderordner
Dim oItems = SharedFolder.Items
For Each oAppt In oItems
TextBox1.Text &= "start: " & oAppt.Start & "; end: " & oAppt.End & "; subj: " & oAppt.Subject & vbCrLf
Next
End If
End Sub
Private Sub CalReader_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Kalender = My.Application.CommandLineArgs(0) ' z.B. "Jane Doe", "Doe, Jane" oder "jane.doe@firma.com"
KalenderLesen(Kalender)
End Sub
End Class
Alles anzeigen
Zudem habe ich einen Verweis auf die 'Microsoft Outlook 14.0 Object Library' und den Namespace 'Microsoft.Office.Interop.Outlook' importiert.