【问题标题】:How to workaround a pop up classification when sending mail?发送邮件时如何解决弹出分类?
【发布时间】:2018-03-06 10:48:51
【问题描述】:

我使用 VBA 发送电子邮件。每封电子邮件都会弹出一个分类,需要手动设置。我正在尝试在代码中解决这个问题。

我找到了发送电子邮件的代码:Mail a message with outlook via VBA
在修复了一些东西之后,下面的代码就可以工作了。

Sub sendEmail()
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
'Working in Office 2000-2016
    Dim OutApp As Object
    Dim OutMail As Object
    Dim cell As Range
    
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Set OutApp = CreateObject("Outlook.Application")
    
    On Error GoTo cleanup
    For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
        Set OutMail = OutApp.CreateItem(0)
        On Error Resume Next
        With OutMail
            .To = cell.Value
            .Subject = "Reminder"
            .Body = "Dear " & Cells(cell.Row, "A").Value _
              & vbNewLine & vbNewLine & _
              "Please Finish your course " & Cells(cell.Row, "C") & _
              " before expiry date."
            .Send  'Or use Display
        End With
        On Error GoTo 0
        Set OutMail = Nothing
    Next cell

cleanup:
    Set OutApp = Nothing
    Application.ScreenUpdating = True
End Sub

问题是,从列表中向例如 10 个人发送电子邮件后,我需要点击分类弹出 10 次。

我发现了这个:How to save workbook and handle TITUS (or any other document classification add-in) popup?

我在.Send 之前尝试过.EnableEvents = False。我不确定这是否对我有用。

在我的情况下如何使用它?是否可以禁用它、解决它,甚至在代码中设置一个分类?

【问题讨论】:

  • 它是 Outlook 或 Excel 的加载项吗?您是否尝试过至少在代码执行期间完全禁用加载项?
  • @AntiDrondert 它由公司为所有 Microsoft Office 应用程序安装。来处理信息。不能禁用。由outlook在外发电子邮件上完成的弹出窗口。
  • 您需要更改 TITUS 的设置。联系您的管理员并告诉他们您在做什么。

标签: excel vba outlook


【解决方案1】:

有一种解决方法,但您必须在 Outlook Developer 本身中执行此操作。您可以在 Outlook 中设置触发宏的事件处理程序。因此,在这种情况下,Outlook 可以监视使用特定主题行创建的消息(例如),这将触发下面的脚本,从而绕过 TITUS。

'Sets Titus Mail settings and sends mail
    With AOMailMsg
        objMsg.ItemProperties.Add("ABCDE.Registered To", olText) = "My Companies"

        objMsg.ItemProperties.Add("ABCDE.Classification", olText) = "Internal"
        objMsg.UserProperties.Add("ABCDE.Registered To", olText) = "My Companies"
        objMsg.UserProperties.Add("ABCDE.Classification", olText) = "Internal"
        objMsg.UserProperties.Add("TITUSAutomatedClassification", olText) = _
             "TLPropertyRoot=ABCDE;.Registered To=My Companies;.Classification=Internal;"
        objMsg.Send
    End With

【讨论】:

  • 在这种情况下什么是 ABCDE?说 Excel 实例也可以这样吗?
猜你喜欢
  • 1970-01-01
  • 2011-11-06
  • 2023-04-05
  • 1970-01-01
  • 2018-05-23
  • 2019-08-08
  • 1970-01-01
  • 2017-04-07
  • 1970-01-01
相关资源
最近更新 更多