MailItem.Save错误地为修改后的MailItem.Subject主题工作 [英] MailItem.Save incorrectly working for modified MailItem.Subject subject
问题描述
你好,
我们的组织开始推出"[外部]"来自我们组织外部的电子邮件回复的原始主题。这会导致这些回复不会放入具有相同(原始)主题的Outlook对话中。
我正在尝试删除"[外部]"希望将来自外部电子邮件的电子邮件回复到对话中的电子邮件主题。
这是我在互联网上找到的代码:
Public Sub ClearSubject(Item as Outlook.MailItem)
Dim arr As Variant,i As Long
'列表要删除的短语
arr = Array(" [External]")
For i = 0 To UBound(arr)
Item.Subject = Replace(Item。 Subject,arr(i),"")
Next
If Item.Saved = False Then
Item.Subject = Trim $(Item.Subject)
Item.Save
结束如果
结束子
我创建了一条规则,以便在每次收到消息时运行ClearSubject。
它有点奏效,看起来像"[外部]"被删除,新主题是"Re:" +原始主题,但是:
- 如果我根据主题安排邮件分组,则回复不会与原始邮件分组到同一组中
- 如果我选择显示为对话除此之外,[外部]将再次显示在电子邮件列表中的主题中,但电子邮件详细视图中未显示[外部] br />
知道可能出现什么问题吗?
要显示为对话的一部分,电子邮件需要具有正确的对话索引(二进制属性) - 请参阅
https://msdn.microsoft.com/en-us/库/办公室/ cc765583.aspx F = 255安培; MSPPError = -2147217396
Hello,
Our organization started putting "[External]" in front of original subject for email replies coming from outside our organization. This causes these replies are not put into to Outlook conversations with the same (original) subject.
I am trying to remove "[External]" from the email subject upon email reception with the hope to put emails replies from external emails back into the conversation.
Here is the code I found somewhere on the internet:
Public Sub ClearSubject(Item As Outlook.MailItem) Dim arr As Variant, i As Long 'List of phrases to be removed arr = Array("[External] ") For i = 0 To UBound(arr) Item.Subject = Replace(Item.Subject, arr(i), "") Next If Item.Saved = False Then Item.Subject = Trim$(Item.Subject) Item.Save End If End Sub
I created a rule to run ClearSubject each time a message is received.
It somewhat works, it looks like "[External]" is removed, new subject is "Re: " + original subject, but:
- If I arrange messages grouping according to Subject, the reply is not grouped into the same group as the original message
- If I select Show as conversations in addition to that, [External] is again showed in the subject in the list of emails, but no [External] is shown in the email detailed view
Any idea what might be wrong?
To be shown as part of a conversation, the email needs to have the right conversation index (binary property) - see https://msdn.microsoft.com/en-us/library/office/cc765583.aspx?f=255&MSPPError=-2147217396
这篇关于MailItem.Save错误地为修改后的MailItem.Subject主题工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!