Hi all,
I have a bit of code that opens up a new calendar appointment, which does the trick just fine, except for the fact that it opens my default Outlook calendar and not my shared calendar. Does anyone know if it's possible to select a shared calendar by default?
Here is the code I have added to a button in my form.
Code:
Dim ouEvent As Outlook.AppointmentItem
Dim ouApp As Outlook.Application
Dim dteStartDate As Date
Dim strSubject As String
Dim strProgrammeCode
If IsNull([Programme Start Date]) Then
MsgBox ("Complete start date info")
Else
strProgrammeCode = DLookup("[Programme Code]", "tblProgrammeList", "ProgrammeID=" & [Programmes])
dteStartDate = Me.Programme_Start_Date.Value
Set ouApp = CreateObject("Outlook.Application")
Set ouEvent = ouApp.CreateItem(olAppointmentItem)
strSubject = strProgrammeCode & " " & Me.Organisation_Name.Value
With ouEvent
.Start = dteStartDate
.AllDayEvent = True
.Subject = strSubject
.Save
.Display
End With
Set ouEvent = Nothing
Set ouApp = Nothing
End If
Thanks for your help
Simon