ItemSend
에 코드를 삽입하고 ThisOutlookSession 모듈을 저장했습니다. 그것은 한 번 작동하고 더 이상 작동합니다. VBAproject.OTM으로 저장되었으며 Outlook을 다시 시작한 후에 모듈을 열 때 계속 남아 있습니다. 당신이 ItemSend
이벤트를 후킹하는 경우Outlook 2007의 ItemSend 이벤트에서 숨은 참조가 작동하지 않습니다.
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 = "[email protected]"
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
FWIW는 이메일 주소가 항상 해결되므로 해결 방법을 호출하거나 값을 확인할 필요가 없습니다. – JimmyPena