我的代码符合预期:
Public WithEvents myItem As Outlook.MailItem
Private Sub Application_ItemLoad(ByVal Item As Object)
If Item.Class = olMail Then
Set myItem = Item
End If
End Sub
Private Sub myItem_Open(Cancel As Boolean)
Dim oAccount As Outlook.Explorer
Dim oMail As MailItem
Set oAccount = Application.ActiveExplorer
MsgBox (oAccount.CurrentFolder.Store)
If oAccount.CurrentFolder.Store = "test@test.com" Then
MsgBox ("CC needs to be added")
Else
MsgBox ("no need to add CC")
End If
End Sub
我想添加类似oAccount.CC =" email_address"自动填写碳复制字段。
答案 0 :(得分:0)
使用
set Recip = myItem.Recipients.Add("user@test.demo")
Recip.Type = olCC