首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Outlook中通过php-ews设置类别颜色

在Outlook中通过php-ews设置类别颜色
EN

Stack Overflow用户
提问于 2015-10-21 07:47:19
回答 1查看 1.2K关注 0票数 0

嗨,我目前正在讨论如何在创建或更新日历事件时通过php-ews设置类别颜色。

我正在使用exchange 2013服务器。

请参阅下面的基本示例:

代码语言:javascript
复制
<?php
$ews = new ExchangeWebServices($host, $username, $password, $version);

// Start building the request.
$request = new EWSType_CreateItemType();
$request->Items = new EWSType_NonEmptyArrayOfAllItemsType();
$request->Items->CalendarItem = new EWSType_CalendarItemType();

// Set the subject.
$request->Items->CalendarItem->Subject = 'Basic Calendar Item Insertion';

// Set the start and end times.
$date = new DateTime('8:00 AM');
$request->Items->CalendarItem->Start = $date->format('c');
$date->modify('+1 hour');
$request->Items->CalendarItem->End = $date->format('c');

// Set no reminders
$request->Items->CalendarItem->ReminderIsSet = false;

// Or use this to specify when reminder is displayed (if this is not set, the default is 15 minutes)
$request->Items->CalendarItem->ReminderMinutesBeforeStart = 15;

// Build the body.
$request->Items->CalendarItem->Body = new EWSType_BodyType();
$request->Items->CalendarItem->Body->BodyType = EWSType_BodyTypeType::HTML;
$request->Items->CalendarItem->Body->_ = 'This is <b>the</b> body';

// Set the item class type (not required).
$request->Items->CalendarItem->ItemClass = new EWSType_ItemClassType();
$request->Items->CalendarItem->ItemClass->_ = EWSType_ItemClassType::APPOINTMENT;

// Set the sensativity of the event (defaults to normal).
$request->Items->CalendarItem->Sensitivity = new EWSType_SensitivityChoicesType();
$request->Items->CalendarItem->Sensitivity->_ = EWSType_SensitivityChoicesType::NORMAL;

// Add some categories to the event.
$request->Items->CalendarItem->Categories = new EWSType_ArrayOfStringsType();
$request->Items->CalendarItem->Categories->String = array('Testing', 'php-ews');

// Set the importance of the event.
$request->Items->CalendarItem->Importance = new EWSType_ImportanceChoicesType();
$request->Items->CalendarItem->Importance->_ = EWSType_ImportanceChoicesType::NORMAL;

// Don't send meeting invitations.
$request->SendMeetingInvitations = EWSType_CalendarItemCreateOrDeleteOperationType::SEND_TO_NONE;

$response = $ews->CreateItem($request);

如您所见,我可以添加多个类别。

有没有人知道是否可以包括类别颜色?

我是否需要调整php-ews库以包含类似于C#示例这里的代码?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-22 03:07:25

类别的颜色取决于主类别列表,该列表是每个邮箱配置项.You access/使用EWS设置它们(请参阅http://www.infinitec.de/post/2011/07/28/Working-with-the-Master-Category-List%E2%80%93EWS-edition.aspx ),但这是在每个邮箱基础上完成的。

干杯格伦

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33253679

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档