Function terminnachoutlook(dtStart As String, intDauer As Integer, strBetreff As String, strKommentar As String, bolErinnerung As Boolean, intErinnerungMinuten As Integer) As Boolean
On Error GoTo FehlerBehandlung
Dim oOutlookApp As Outlook.Application
Dim oOutlookTermin As Outlook.AppointmentItem
Set oOutlookApp = CreateObject(„Outlook.Application“)
Set oOutlookTermin = oOutlookApp.CreateItem(olAppointmentItem)
With oOutlookTermin
.Start = dtStart
.Duration = intDauer
.Subject = strBetreff
.Body = strKommentar
.ReminderSet = bolErinnerung
.ReminderMinutesBeforeStart = intErinnerungMinuten
.Save
End With
Set oOutlookTermin = Nothing
Set oOutlookApp = Nothing
terminnachoutlook = True
Exit Function
FehlerBehandlung:
MsgBox Err.Number & “ “ & Err.Description
terminnachoutlook = False
End Function
Im Modul gehen Sie auf Extras ==> Verweise. Markieren Sie den Eintrag Microsoft Outlook 11.0 Objekt Library.
Bestätigen Sie das mit OK.