Partager via


_CalendarView.SelectedStartTime Property

Returns a DateTime value that represents the start time of a selection in the CalendarView object. Read-only.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
ReadOnly Property SelectedStartTime As DateTime
    Get
'Usage
Dim instance As _CalendarView
Dim value As DateTime

value = instance.SelectedStartTime
[DispIdAttribute()]
DateTime SelectedStartTime { get; }

Property Value

Type: System.DateTime

Remarks

The intent of the SelectedStartTimeSelectedEndTime properties is to replicate, programmatically, the way that users create an appointment in the Microsoft Outlook user interface. Typically, a user selects a time range in the calendar view and then creates a new appointment by double clicking the selection or by clicking New Appointment in the Home tab of the Microsoft Office Fluent ribbon. With these two properties of the CalendarView object, you can obtain the start time and the end time of any selection in that view programmatically. You can then programmatically create the AppointmentItem object, setting the Start and End properties of the AppointmentItem object to the SelectedStartTime and SelectedEndTime properties respectively to reflect any user selection in the calendar view.

If the selection in the calendar view is a time range and is not an item, SelectedStartTime returns a DateTime value equal to the start time of the selection.

If one or more items are selected in the calendar view, SelectedStartTime returns a DateTime value equal to the start time of the first item in the selection of the explorer that displays the calendar view. That selection is specified by the Selection property of the Explorer object.

To use this property on a CalendarView object, obtain the CalendarView object from the CurrentView property of the active Explorer object (which can be returned by the ActiveExplorer() method). There is a known issue with using this property on an CalendarView object obtained otherwise - using the CurrentView property of the current Folder object (returned by the CurrentFolder property of the object represented by Application.ActiveExplorer).

See Also

Reference

_CalendarView Interface

_CalendarView Members

Microsoft.Office.Interop.Outlook Namespace