我想通过我的Xamarin.Mac应用程序在Mac Microsoft outlook日历中添加带有内容的约会日期。有可能做到这一点吗。
发布于 2015-10-22 14:04:44
不确定是否有编程API,但您应该能够生成纯文本和文档格式的.ics文件,当单击它们时,它们可以在outlook或任何其他像样的日历应用程序中打开并保存。
发布于 2015-10-22 15:08:48
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#中动态创建这些脚本,将它们保存为临时文件,然后通过osascript从cmd行(通过Process.Start)执行它们。
打开Apple Script Editor并加载适用于您的Outlook版本的字典,即: Outlook 2016/日历套件的日历事件包含以下所有属性:
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.https://stackoverflow.com/questions/33273963
复制相似问题