zhangronghua

单位邮箱的空间太小,只有几十M,发送几个大邮件后就会占满邮箱空间了,对于收件箱中的邮件可以通过Pop3进行备份,但是发件箱中的邮件备份比较麻烦,Outlook默认没有BCC到指定邮箱的功能,不过我们可以用宏来解决这个难题,步骤如下:

  1. Alt+F11打开宏编辑器
  2. 在工程面板中打开“Project (VbaProject.OTM)/Microsoft Office Outlook 对象/ThisOutlookSession”;
  3. 输入以下的代码:
    Option Explicit
     
    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
        Dim oItem As MailItem
        Dim oRecipient As Recipient
        
        If Item Is Nothing Then
        Else
            If TypeOf Item Is Outlook.MailItem Then
            
                Set oItem = Item
                 
                \' 在这里参考如下代码根据需要增删BCC收件人
                Set oRecipient = oItem.Recipients.Add("izhangronghua@gmail.com")
                oRecipient.Type = Outlook.olBCC
                \'Set oRecipient = oItem.Recipients.Add("user2@server2.com")
                \'oRecipient.Type = Outlook.olBCC
                \'Set oRecipient = oItem.Recipients.Add("user3@server3.com")
                \'oRecipient.Type = Outlook.olBCC
                 
                oItem.Recipients.ResolveAll
                oItem.Save
                Set oRecipient = Nothing
                Set oItem = Nothing
            End If
        End If
    End Sub
    

      

  4. 保存并退出宏编辑器
  5. Outlook的“工具”->“信任中心”->“宏安全性”中选择“为所有宏提供警告”。

经过以上的操作后,以后所有发送的邮件都会自动BCC到指定的邮箱中,起到了备份的作用。 

分类:

技术点:

相关文章:

  • 2021-12-10
  • 2021-08-11
  • 2022-01-27
  • 2021-10-27
  • 2022-12-23
  • 2021-04-10
  • 2021-04-02
  • 2022-01-21
猜你喜欢
  • 2021-12-18
  • 2021-11-27
  • 2021-12-11
  • 2021-12-16
  • 2022-01-01
  • 2021-11-22
相关资源
相似解决方案