当我单击新电子邮件 Outlook 时,自动抄送电子邮件不会出现在抄送文本区域中的 VBA 代码中,请帮助我这样做我已经在 Application_ItemSend 事件中使用 VBA 添加抄送,但它出现在消息发送后我想显示抄送当用户单击 Outlook 功能区中的新消息时..
问问题
1775 次
2 回答
0
在此处查看 NewInspector 事件示例
Public WithEvents myOlInspectors As Outlook.Inspectors
Private Sub Application_Startup()
Initialize_handler
End Sub
Public Sub Initialize_handler()
Set myOlInspectors = Application.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
Dim msg As Outlook.MailItem
If Inspector.CurrentItem.Class = olMail Then
Set msg = Inspector.CurrentItem
If msg.Size = 0 Then
MsgBox "New message"
End If
End If
End Sub
于 2013-10-26T23:38:18.803 回答
0
我认为这就是您要发布代码以更清晰的内容。
strcc = "xxx@yyy.com"
Dim objRecip As Recipient
Set objRecip = Item.Recipients.Add(strcc)
objRecip.Type = olCC
If Not objRecip.Resolve Then
strMsg = "Could not resolve the cc recipient. " & _
"Do you want still to send the message?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"Could Not Resolve cc Recipient")
If res = vbNo Then
Cancel = True
End If
End If
Set objRecip = Nothing`
于 2013-06-11T05:37:51.647 回答