Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Operation failed in Bcc field (http://www.outlookbanter.com/add-ins-outlook/5737-operation-failed-bcc-field.html)

Simone January 9th 06 11:18 AM

Operation failed in Bcc field
 
Hi everyone

I've created an AddIn for Outlook2k3 using Vb6
My AddIn use the Application_ItemSend Event to add some address in the Bcc
field.

This task work fine however if Bcc is already populated with a distribution
list, sometimes outllook show the messagebox "The operation failed".
It seems outllook cannot resolve some of the contact in the DL, if i remove
them from the list before sending the mail no warning is displayed and the
mail is sent correctly

If i disable my AddIn and send a message to the same DL without removing
contacts, no problem at all.

Here is the code that add the Bcc

private sub olApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.BCC = Item.BCC & myAddress
Item.Recipients.ResolveAll
end sub

*myAddress contain a valid mail address in exchange/outlook format, that is
"Test"

My code raise no exception, it seems a contact resolution problem but i cant
understand why it appears only when my addin is enabled.

Any help would be greatly appreciated.
Many thanks
Simone

Sachin Sancheti January 11th 06 07:15 AM

Operation failed in Bcc field
 
You could try following:

1.
private sub olApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.BCC = Item.BCC & ";" & myAddress
Item.Recipients.ResolveAll
end sub
2.
Use Recipients collection:
Dim objRec as Recipient
Set objRec = Item.Recipients.Add(myAddress)
objRec.Type = olBcc '3


Simone January 11th 06 08:27 AM

Operation failed in Bcc field
 
Thanks for your reply Sachin

Solution 2 works great!
Thank you very much

Simone

"Sachin Sancheti" wrote:

You could try following:

1.
private sub olApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.BCC = Item.BCC & ";" & myAddress
Item.Recipients.ResolveAll
end sub
2.
Use Recipients collection:
Dim objRec as Recipient
Set objRec = Item.Recipients.Add(myAddress)
objRec.Type = olBcc '3




All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com