在公司使用outlook处理邮件,发出的邮件只在办公的电脑里有,换一台电脑,就只能在WEB端查找收到的邮件了,这个问题困扰过我一段时间,最近找到这个解决方案,使用VBA写一段代码,告诉OUTLOOK每发出一封邮件,都密送给自己一封邮件。具体方法见下:
- 在Outlook里面键入Alt+F11打开VBA编辑器;
- 激活左边的工程面板,展开并双击上面的“Project (VbaProject.OTM)/Microsoft Office Outlook 对象/ThisOutlookSession”;
- 将下面的代码粘贴到右边打开的编辑区里面去:
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
On Error Resume Next
' #### USER OPTIONS ####
' address for Bcc — must be SMTP address or resolvable
' to a name in the address book
strBcc = "someome@yuming.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
End Sub
将someome@yuming.com替换为想要密送的邮箱地址,保存退出即可
4.选择菜单“工具-信任中心”,在弹出窗口中选择“宏安全性”,选择“为所有宏提供警告”或者“不执行宏安全性检查”(建议选择前者);
5.重新启动Outlook,看到提示是否否用宏,选择启用。
6.现在,新建邮件中虽然看不到密送收件人,但是发出去的每一封邮件都会自动抄送给了代码中设置的那些BCC收件人了。
网友评论