C# OOF回复的字体
我目前正在为Outlook开发一个外接程序。此加载项编辑已登录Outlook用户的OOF设置。我必须从.oft文件中获取外部消息的文本。C# OOF回复的字体,c#,outlook,outlook-addin,exchangewebservices,C#,Outlook,Outlook Addin,Exchangewebservices,我目前正在为Outlook开发一个外接程序。此加载项编辑已登录Outlook用户的OOF设置。我必须从.oft文件中获取外部消息的文本。 外接程序运行良好,一切正常。字体有一个小问题。我想更改这两个回复的字体,以符合我们公司的标准,但我认为没有办法实现这一点 有没有办法更改字体?您可以获取要更改的项目,然后根据需要进行更新。您需要做的是获取邮件的正文-属性,然后更改此正文中的-标记: // As a best practice, limit the properties returned to
外接程序运行良好,一切正常。字体有一个小问题。我想更改这两个回复的字体,以符合我们公司的标准,但我认为没有办法实现这一点
有没有办法更改字体?您可以获取要更改的项目,然后根据需要进行更新。您需要做的是获取邮件的
正文
-属性,然后更改此正文中的
-标记:
// As a best practice, limit the properties returned to only those that are required.
PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Body);
// Bind to the existing item by using the ItemId.
// This method call results in a GetItem call to EWS.
Item item = Item.Bind(service, itemId, propSet);
// item.Body.value = "<html><body> Example body </body></html>"
// Update the style of the mail's body.
item.Body.value = "<html><body style='font-family: Arial'> Example body </body></html>"
// Save the updated email.
// This method call results in an UpdateItem call to EWS.
item.Update(ConflictResolutionMode.AlwaysOverwrite);
//作为最佳实践,将返回的属性限制为仅需要的属性。
PropertySet propSet=新的PropertySet(BasePropertySet.IdOnly,ItemSchema.Body);
//使用ItemId绑定到现有项。
//此方法调用导致对EWS的GetItem调用。
Item=Item.Bind(服务、itemId、propSet);
//item.Body.value=“示例Body”
//更新邮件正文的样式。
item.Body.value=“示例Body”
//保存更新的电子邮件。
//此方法调用导致对EWS的UpdateItem调用。
项目更新(冲突解决模式AlwaysOverwrite);
您可以获取要更改的项目,然后根据需要进行更新。您需要做的是获取邮件的正文
-属性,然后更改此正文中的
-标记:
// As a best practice, limit the properties returned to only those that are required.
PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Body);
// Bind to the existing item by using the ItemId.
// This method call results in a GetItem call to EWS.
Item item = Item.Bind(service, itemId, propSet);
// item.Body.value = "<html><body> Example body </body></html>"
// Update the style of the mail's body.
item.Body.value = "<html><body style='font-family: Arial'> Example body </body></html>"
// Save the updated email.
// This method call results in an UpdateItem call to EWS.
item.Update(ConflictResolutionMode.AlwaysOverwrite);
//作为最佳实践,将返回的属性限制为仅需要的属性。
PropertySet propSet=新的PropertySet(BasePropertySet.IdOnly,ItemSchema.Body);
//使用ItemId绑定到现有项。
//此方法调用导致对EWS的GetItem调用。
Item=Item.Bind(服务、itemId、propSet);
//item.Body.value=“示例Body”
//更新邮件正文的样式。
item.Body.value=“示例Body”
//保存更新的电子邮件。
//此方法调用导致对EWS的UpdateItem调用。
项目更新(冲突解决模式AlwaysOverwrite);
Body.Html允许您指定强制类型。在这里,您可以指定HTML并向正文中的文本添加样式。例如:
Office.context.mailbox.item.body.setAsync(
“text
“,
{强制类型:“html”},
函数回调(结果){
//处理结果
});
Body.Html允许您指定强制类型。在这里,您可以指定HTML并向正文中的文本添加样式。例如:
Office.context.mailbox.item.body.setAsync(
“text
“,
{强制类型:“html”},
函数回调(结果){
//处理结果
});代码>谢谢你的帮助
最简单的方法是将html标记添加到我用于OofReply
-对象的字符串中。类似于:string message=“+template.body+”代码>谢谢您的帮助
最简单的方法是将html标记添加到我用于OofReply
-对象的字符串中。类似于:string message=“+template.body+”代码>