自动替换入站 Outlook 电子邮件中的主题行

发布于 2024-11-19 20:41:50 字数 76 浏览 3 评论 0原文

我需要将所有传入电子邮件(无论它可能是什么)的主题行内容替换为“息税前利润支持”,然后将同一邮件转发到新的正确收件箱 - 非常欢迎的想法!

I need to replace the contents of the subject line of all incoming email (whatever it maybe ) with "EBIT Support" and that same mail then forwarded to the new and correct inbox- an ideas vey welcome!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的憧憬 2024-11-26 20:41:51

我假设您正在寻找 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

I assume you are looking for VBA code. Do you have any code written at all?

I have some stock event code that can be adapted for your purposes:

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文