Operation failed in Bcc field

G

Guest

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" <[email protected]>

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
 
S

Sachin Sancheti

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top