2017-09-05 3 views
0

내 코드는 다음과 같은 사람 필드로 전환 :항목은

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 
    Dim Recip As Outlook.Recipient 

    Set oAccount = Application.ActiveExplorer 
    MsgBox (oAccount.CurrentFolder.Store) 

    If oAccount.CurrentFolder.Store = "[email protected]" Then 
     MsgBox ("CC needs to be added") 

     Set Recip = myItem.Recipients.Add("[email protected]") 
     Recip.Type = olBCC 
    Else 
     MsgBox ("no need to add CC") 
    End If 
End Sub 

에 그 주소를 추가 참조 필드에 [email protected]를 추가하기위한 책임이있는 부분 "받는 사람 :" 필드 대신.

+1

VBA 인 경우 vba 태그를 사용하십시오. VB.NET 뭔가 다른 것입니다 – Plutonix

답변

0

Recip.Type = olCC 다음에 Recip.Resolve를 추가하기 만하면됩니다. 그것으로 문제가 해결되었습니다.