Outlook 2007을 통해 전송되는 모든 메시지에 자동 VBA 스크립트를 추가했습니다. 코드가 훌륭하게 작동합니다. 내가 가진 문제는 컴퓨터를 다시 시작하고 Outlook 2007을로드 할 때마다 VBA 편집기를 연 후에야 코드가 적용됩니다. 편집기를 닫더라도이 방법으로 제대로 실행됩니다. Outlook 2007을 열 때마다 VBA 편집기를 열고 닫아야합니까? Outlook 2007을 열고로드 할 때 VBA 스크립트가 강제로 작동하도록하는 방법이 있습니까?Outlook 2007에서 실행되지 않는 VBA 스크립트
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 to send the message?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"Could Not Resolve Bcc")
If res = vbNo Then
Cancel = True
End If
End If
Set objRecip = Nothing
End Sub
문제가 당신의 보안 센터 설정에서 오는 것 같다. Outlook의 매크로 보안 설정을 조정해야합니다. 가장 낮은 레벨로 설정하십시오. –