我正在尝试运行一个 VBScript,它在所有传入消息中搜索主题字段上的特定字符串,并将其替换为其他内容,但保留主题内容的其余部分。到目前为止,这是我的代码,但我没有得到任何结果。
传入邮件主题:[EXTERNAL] abcdfed ghijk lmno
我需要什么:[*] abcdfed ghijk lmno
Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rply As Outlook.MailItem
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
msg.Subject = Replace(msg.Subject, "[EXTERNAL]", "[*]")
msg.Save
Set msg = Nothing
Set olNS = Nothing
End Sub
我会感谢你的帮助