从/到RTF,HTML,纯文本获取/设置约会正文类型 [英] Get/Set Appointment Body type from/to RTF,HTML, plain text
问题描述
您好,
是否有一种聪明的方式来获取约会正文类型(RTF,HTML,纯文本)并将其切换为其他值。我已经看到模拟点击相应功能区按钮的技巧,但它看起来并不优雅。
不知何故,能够使用与邮件项目相同的方法是合乎逻辑的。 :
MyAppointment。 BodyFormat = OlBodyFormat。 olFormatRichText
您好
HafezG,
您可以使用相同的方式将约会正文设置为邮件正文。
您可以参考以下链接中的代码示例来提取和设置项目正文。
示例:
strLink =" http://www.outlookcode.com"
strLinkText ="在此处获取Outlook代码示例"
strNewText ="< p>< a href =" &安培; Chr(34)& strLink& _
Chr(34)& ">" &安培; strLinkText& "< / A>< / p为H."
objMsg.HTMLBody =替换(objMsg.HTMLBody,"< / body>",_
strNewText,1,1,vbTextCompare)有关详细示例,请参阅以下链接。
如果您正在使用VSTO,那么您可能需要根据您的要求在VB或C#中转换代码。
感谢您的理解。
问候
Deepak
Hello,
Is there a smart way to get the appointment body type (RTF, HTML, Plain Text) and to switch it to a different value. I have seen tricks which simulate a click on the corresponding ribbon button but it does not look really elegant.
Somehow it will be logical to be able to use the same method than with a mail item:
MyAppointment.BodyFormat = OlBodyFormat.olFormatRichText
Hi HafezG,
you can use the same way to set appointment body as mail body.
you can refer code example from link below to extract and set item body.
example:
strLink = "http://www.outlookcode.com" strLinkText = "Get Outlook code samples here" strNewText = "<p><a href=" & Chr(34) & strLink & _ Chr(34) & ">" & strLinkText & "</a></p>" objMsg.HTMLBody = Replace(objMsg.HTMLBody, "</body>", _ strNewText, 1, 1, vbTextCompare)for detailed examples you can refer link below.
Chapter 17: Working with Item Bodies
if you are working with VSTO then you may need to convert the code in VB or C# according to your requirement.
Thanks for your understanding.
Regards
Deepak
这篇关于从/到RTF,HTML,纯文本获取/设置约会正文类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!