我想在我的Xamarin.Mac应用程序中添加Mac Microsoft Outlook日历中的内容的约会日期。是否可以这样做。
答案 0 :(得分:0)
不确定是否有程序化API,但您应该能够生成纯文本和记录良好的格式的.ics文件,点击后可以在Outlook中打开,或者任何其他体面的日历应用程序,以及保存
答案 1 :(得分:0)
AppleScript将是这样做的方式:
tell application "Microsoft Outlook"
set theSubject to "Test Appointment"
set theContent to "HTML based content here"
set myDate to current date
set newAppointment to make new calendar event with properties {subject:theSubject, content:theContent, start time:myDate + 1 * hours, end time:myDate + (2 * hours)}
open newAppointment
end tell
您可以在C#中动态创建这些脚本,将它们保存为tmp文件,然后从cmd行(通过Process.Start)通过osascript
执行它们。
打开Apple Script Editor并为您的Outlook版本加载词典,即:Outlook 2016 / Calendar Suite的日历事件包含以下所有属性:
calendar event n [inh. categorizable object > object > item] : A calendar event.
properties
subject (text) : The subject of an event.
start time (date) : The time at which an event begins.
end time (date) : The time at which an event ends.
location (text) : The location of an event.
content (text) : The HTML description of the event.
plain text content (text) : The description of the event as plain text.
has html (boolean, r/o) : Indicates whether the description of the event has html text?
all day flag (boolean) : A flag for whether or not an event is an all day event.
has reminder (boolean) : Indicates whether or not an event has a reminder.
reminder time (integer) : The number of minutes from the start time of an event when a reminder will fire (if it has one).
free busy status (busy/free/tentative/out of office) : The free/busy status for an event.
exchange id (text, r/o) : The exchange identifier of an event (only applicable for events belonging to exchange accounts).
modification date (date, r/o) : The date an event was last modified on.
recurrence (recurrence or missing value) : The calendar recurrence.
is recurring (boolean, r/o) : Indicates whehter an event is part of a recurring series of events.
is occurrence (boolean, r/o) : Indicates whether an event is an occurrence of a recurring series.
recurrence id (date, r/o) : The recurrence id of an event (the date at which the recurring event occurs).
master (calendar event, r/o) : The master event for an event that is an exception from a recurring series.
is private (boolean) : Indicates whether an event is private.
calendar (calendar, r/o) : The calendar folder in which an event is filed.
account (account, r/o) : The account associated with an event.
organizer (text, r/o) : The organizer of the meeting.
timezone (timezone) : The timezone of an event.
request responses (boolean) : Indicates whether a response is requested from the attendees of the meeting.
icalendar data (text, r/o) : The information of an event in iCalendar format. Use the 'import ics' command to create an event from iCalendar information.