Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# OOF回复的字体_C#_Outlook_Outlook Addin_Exchangewebservices - Fatal编程技术网

C# OOF回复的字体

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

我目前正在为Outlook开发一个外接程序。此加载项编辑已登录Outlook用户的OOF设置。我必须从.oft文件中获取外部消息的文本。
外接程序运行良好,一切正常。字体有一个小问题。我想更改这两个回复的字体,以符合我们公司的标准,但我认为没有办法实现这一点


有没有办法更改字体?

您可以获取要更改的项目,然后根据需要进行更新。您需要做的是获取邮件的
正文
-属性,然后更改此正文中的
-标记:

// 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+”