Sub
auswahlNachOutlook()
Dim
StartDatum
As
Date
Dim
Dauer
As
Long
Dim
Beschreibung
As
String
Dim
Nachricht
As
String
Dim
Ort
As
String
StartDatum =
CDate
(Cells(ActiveCell.Row, 3).Value)
Dauer = Cells(ActiveCell.Row, 4).Value
Beschreibung = Cells(ActiveCell.Row, 5).Value
Nachricht = Cells(ActiveCell.Row, 6).Value
Ort = Cells(ActiveCell.Row, 7).Value
lvOutlook StartDatum, Dauer, Beschreibung, Nachricht, Ort
End
Sub
Public
Function
lvOutlook(
ByVal
outDate
As
Date
, outDauer
As
Long
, outSubject
As
String
, outBody
As
String
, outlocation
As
String
)
As
Boolean
Set
OutApp = CreateObject(
"Outlook.Application"
)
Set
apptOutApp = OutApp.CreateItem(1)
With
apptOutApp
.Start = cdate(DateSerial(Year(outDate), Month(outDate), Day(outDate)) + TimeSerial(8, 0, 0))
.Subject = outSubject
.Location = outlocation
.Duration = outDauer
.ReminderPlaySound =
True
.ReminderSet =
True
.Save
End
With
Set
apptOutApp =
Nothing
Set
OutApp =
Nothing
lvOutlook =
True
MsgBox
"Termin an Outlook übertragen."
Exit
Function
ErrOutLook:
Set
apptOutApp =
Nothing
Set
OutApp =
Nothing
lvOutlook =
False
MsgBox
"Termin konnte in Outlook nicht eingetragen werden. Fehler:"
& Err.Description
End
Function