简体   繁体   English

如何在 SENT 电子邮件 Outlook 2010 VBA 中隐藏密件抄送字段

[英]How to hide BCC field in SENT email Outlook 2010 VBA

I have a macro coded to a rule that autoforwards all incoming and sent emails to a private email address in the BCC field (any auto BCC rule is disabled at the server level.) With the help of the board here, the macro works flawlessly, and for all intents and purposes is invisible.我有一个宏编码到一个规则,自动转发所有传入和发送的电子邮件到密件抄送字段中的私人电子邮件地址(在服务器级别禁用任何自动密件抄送规则。)在董事会的帮助下,宏可以完美地工作,并且出于所有意图和目的是不可见的。

However, if you open the SENT message in the SENT FOLDER, the BCC field is visible to all for the world to see.但是,如果您在 SENT FOLDER 中打开 SENT 消息,BCC 字段对所有人可见。 I have learned this is a "feature" in Outlook, apparently since 2003.我了解到这是 Outlook 中的一个“功能”,显然是从 2003 年开始的。

Is there a way to suppress the visibility of the BCC field when viewing the SENT email?查看 SENT 电子邮件时,有没有办法抑制 BCC 字段的可见性?

Or is there a way one can set the display options of an individual folder NOT to display a BCC - EVER?或者有没有一种方法可以将单个文件夹的显示选项设置为不显示密件抄送 - 永远?

Thank you for any assistance.感谢您提供任何帮助。

My code:我的代码:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

      Dim objRecip As Recipient
      Dim strMsg As String
      Dim res As Integer
      Dim strBcc As String
      Dim answer
      Dim oAtt
      Dim strProc1 As String

On Error GoTo Application_ItemSend_Error

strBcc = "myprivateemail@gmail.com"

Set objRecip = Item.Recipients.Add(strBcc)
objRecip.Type = olBCC

If Not objRecip.Resolve Then
    strMsg = "Could not resolve the Bcc recipient. " & _
    "Do you want still to send the message?"
    res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
    "Could Not Resolve Bcc Recipient")
    If res = vbNo Then
        Cancel = True
    End If
End If

Set objRecip = Nothing

On Error GoTo 0
Exit Sub

Application_ItemSend_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") " & "Error on 
Line " & Erl & " in procedure Application_ItemSend of VBA Document
ThisOutlookSession"

End Sub

如果要删除 Sent Items 文件夹中的 BCC 收件人,请侦听 Sent Items 文件夹上的 Items.ItemAdd 事件,遍历MailItem.Recipients集合中的所有收件人并删除Recipient.Type = olBCC

"the BCC field is visible to all for the world to see" “BCC 字段对所有人可见,全世界都可以看到”

Well, if anyone in the world can view your own sent folder, then this is the case.好吧,如果世界上任何人都可以查看您自己的已发送文件夹,那么就是这种情况。 Otherwise the BCC field is not part of the email, recipients do not receive it.否则 BCC 字段不是电子邮件的一部分,收件人不会收到它。 The goal of the feature is to have the ability to recall your own BCC messages, so you do not forget that you have sent them.该功能的目标是能够召回您自己的密件抄送消息,这样您就不会忘记您已经发送了它们。

Try the following...尝试以下...

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim olRec As Outlook.Recipient
    Dim Address$

    Address = "Om3r@blala.com"

    Set olRec = Item.Recipients.Add(Address)
    olRec.Type = olBCC
    olRec.Resolve
End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM