简体   繁体   English

Microsoft.Office.Interop.Outlook临时更改电子邮件正文

[英]Microsoft.Office.Interop.Outlook temporarily change email body

I need to change email body using Microsoft.Office.Interop.Outlook (C# Outlook Adding). 我需要使用Microsoft.Office.Interop.Outlook(C#Outlook添加)更改电子邮件正文。 But I need to change it only for presentation, not permanently. 但是我需要仅出于演示目的更改它,而不是永久更改。 It means: When user select another email, click replay/forward, etc. the email body must be returned into original. 这意味着:当用户选择另一封电子邮件时,单击“重播/转发”等。电子邮件正文必须恢复为原始。 I don't want change the email body permanently. 我不想永久更改电子邮件正文。

I am able to access and edit the body by this property but it is permanent and saved on Exchange server. 我可以通过属性访问和编辑正文,但它是永久的,并保存在Exchange服务器上。 Is there any other solution of my problem? 我的问题还有其他解决办法吗?

Thanks a lot for answers, Miroslav Jasso 非常感谢您的回答,Miroslav Jasso

It sounds like you want to preseve the original message body of the source item that is replied to in the replied/forwarded message that is sent out. 听起来您好像想在发送出去的已回复/转发邮件中预先保留源项目的原始邮件正文。 To do so you'd need to store the original MailItem.HTMLBody property value in a custom property within the outgoing message. 为此,您需要将原始MailItem.HTMLBody属性值存储在传出消息内的自定义属性中。 You can do that by adding a UserProperty to the MailItem.UserProperties collection. 您可以通过将UserProperty添加到MailItem.UserProperties集合中来实现。 However, there is a limit to the size of the property value that can be used and this can be exceeded if an email has a very big message body. 但是,可以使用的属性值的大小有限制,如果电子邮件的邮件正文很大,则可以超过此限制。 You may need to save the original message body in an attachment if this occurs. 如果发生这种情况,您可能需要将原始邮件正文保存在附件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM