Thảo luận - Nhờ các bạn sửa hộ đoạn VBA để tự động BCC trong Outlook. | VN-Zoom | Cộng đồng Chia Sẻ Kiến Thức Công Nghệ và Phần Mềm Máy Tính

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We need money to operate the site, and almost all of it comes from our online advertising.

If possible, please support us by clicking on the advertisements.

Please add vn-z.vn to your ad blocking whitelist or disable your adblocking software.

×

Thảo luận Nhờ các bạn sửa hộ đoạn VBA để tự động BCC trong Outlook.

joevnpro

Búa Gỗ Đôi
Nhờ các bạn giúp mình sửa đoạn VAB này để tuỳ khi mình dùng account A gửi mail thì nó BCC đến địa chỉ A1, khi dùng account B gửi mail thì nó bbc đến địa chỉ A2. Vì đoạn code này là gửi email 1 địa chri duy nhất bất kể dùng account nào.

Thank you very much!

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
 

joevnpro

Búa Gỗ Đôi
Đã tự sửa và chạy OK. Up cho cậu nào cần. Chạy bằng VBA của Outlook nhoé.
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
Select Case Item.SenderEmailAddress
Case Is = "tài_khoản_gửi_mail_1"
strBcc = "mail muốn BCC1"
Case Is = "tài_khoản_gửi_mail_2"
strBcc = "mail muốn BCC2"
Case Is = "tài_khoản_gửi_mail_3"
strBcc = "mail muốn BCC4"
Case Is = "tài_khoản_gửi_mail_4"
strBcc = "mail muốn BCC5"
Case Is = "tài_khoản_gửi_mail_n"
strBcc = "mail muốn BCCn"
Case Else
strBcc = "mail muốn BCC nếu ko điều kiện nào đúng"
End Select
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
 

Sniper

Búa Gỗ
Các bro cho em hỏi có cách nào tăng số lượng ruler trong outlook không ạ. em đặt 128 ruler là bị giới hạn ạ.
 


Top