在Outlook中如何实现自动CC
1. 在Outlook里面键入ALT+F11打开VBA编辑器;
2、键入CTRL+R激活左边的那个工程面板,展开并双击上面的“Project (VbaProject.OTM)\Microsoft Office Outlook 对象\ThisOutlookSession”;
3、将下面的代码粘贴到右边打开的编辑区里面去:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strcc As String
On Error Resume Next
strcc = "yourmail@mail.com"
Set objRecip = Item.Recipients.Add(strcc)
objRecip.Type = olCC
If Not objRecip.Resolve Then
strMsg = "不能解析抄送人邮件地址, " & _
"请确认是否仍然发送邮件?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"不能解析抄送人邮件地址")
If res = vbNo Then
Cancel = True
End If
End If
Set objRecip = Nothing
End Sub
4、键入CTRL+S保存,再键入ALT+Q退出VBA编辑器返回Outlook主界面;
6、选择菜单“工具-信任中心”,在弹出窗口中选择“宏安全性”;
7、选择“为所有宏提供警告”
8、重新启动Outlook,看到提示是否否用宏,选择启用。