Edytuj

Udostępnij za pośrednictwem


_CalendarView.SelectedStartTime Property

Definition

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

public:
 property DateTime SelectedStartTime { DateTime get(); };
public DateTime SelectedStartTime { get; }
Public ReadOnly Property SelectedStartTime As DateTime

Property Value

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).

Applies to