Outlook view control and creating appointments over several days (1 Viewer)

kriswork

Registered User.
Local time
Today, 18:48
Joined
Jul 11, 2011
Messages
21
Hi,

I'm using the Outlook view control and I'm trying to create appointments in it.
My code works fine if only one day is highlighted in the calendar (currently in a month view), but the ".SelectedDate" property is of the type data and can't cope with holding a date range (which is fair enough).

Here's what I've got so far which is triggered when I hit a button after I've highlighted one or more days in the Outlook view control:

Private Sub btnCreateAppointment_Click()
Dim OutlookApp As Outlook.Application
Dim Appointment As Outlook.AppointmentItem
Dim OutlookNms As Outlook.NameSpace
Dim OutlookPST As Outlook.MAPIFolder
Dim OutlookCalendar As Outlook.MAPIFolder
Dim OutlookExplorer As Outlook.Explorer
Set OutlookApp = CreateObject("Outlook.application")
Set OutlookNms = OutlookApp.GetNamespace("MAPI")
Set OutlookPST = OutlookNms.Folders("Archive Folders")
Set OutlookCalendar = OutlookPST.Folders("Calendar")
Set Appointment = OutlookCalendar.Items.Add
Appointment.Subject = "Hello"
Appointment.AllDayEvent = True
Appointment.Body = Me.txtNotes
Appointment.Start = Me.OutlookControl.Object.SelectedDate
'Appointment.Start = "20/09/2011 12:00"
'Appointment.End = "21/09/2011 12:00"
Appointment.Save


I'm struggling to find the right property of the view control that is holding the dates I've selected.
I've tried using Me.OutlookControl.Object.selection.???, but when looking in the locals windows I can't see any properties that are holding the date range.

I don't have a problem creating an appointment that spans several days, just a problem reading in what days have been selected
 

kriswork

Registered User.
Local time
Today, 18:48
Joined
Jul 11, 2011
Messages
21
Thanks jdraw for the link.
I don't have a problem creating multiday appoinments though. I have a problem trying to find the right property which holds the days that are currently highlighted on the Outlook View control. SelectedDate is the right one if only 1 day is selected, but not if more than 1 day is selected.

Kris
 

bengiomanni

Registered User.
Local time
Today, 13:48
Joined
Mar 14, 2013
Messages
25
This is quite a bit later, but you guys mention that you use the Outlook View Control. I'm using Access 2010 and I am digging around everywhere trying to find information, but there is almost nothing, and the link I see everywhere for Microsoft documentation leads me to a dead end. Do you have any info on how to set up the OCV on an Access form?
 

Users who are viewing this thread

Top Bottom