【问题标题】:Auto replacement of subject line in inbound Outlook emails自动替换入站 Outlook 电子邮件中的主题行
【发布时间】:2011-10-03 23:26:42
【问题描述】:

我需要用“EBIT Support”替换所有传入电子邮件(不管它可能是什么)的主题行的内容,然后将相同的邮件转发到新的正确收件箱 - 欢迎提出想法!!

【问题讨论】:

    标签: outlook-2003 email-headers


    【解决方案1】:

    我假设您正在寻找 VBA 代码。你有写过代码吗?

    我有一些股票事件代码可以根据您的目的进行调整:

    http://www.codeforexcelandoutlook.com/outlook-vba/stock-event-code/

    Private WithEvents Items As Outlook.Items
    
    Private Sub Application_Startup()
    Dim olApp As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Set olApp = Outlook.Application
    Set objNS = olApp.GetNamespace("MAPI")
    ' (1) default Inbox
    Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
    End Sub
    
    Private Sub Items_ItemAdd(ByVal item As Object)
    
    On Error Goto ErrorHandler
    
      Dim Msg As Outlook.MailItem
    
      ' (2) only act if it's a MailItem
      If TypeName(item) = "MailItem" Then
        Set Msg = item
    
        ' (3) do something here
    
      End If
    
    ProgramExit:
      Exit Sub
    ErrorHandler:
      MsgBox Err.Number & " - " & Err.Description
      Resume ProgramExit
    End Sub
    

    【讨论】:

      猜你喜欢
      • 2013-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多