Recipients Objects

D

David Cebrian

Hello,

Anybody can help me with that problem.

I can not instanciate a variable of type MAPI.Recipients (CDO)
My code fails when I try to use the method Add.

The application returns me that the object do not exists.

Thanks,

My code inside a Form

Public SMScontactes As Outlook.Recipients

Dim ContactesSMS As MAPI.Recipients

Private Sub treuLlistaDis()

Dim i, k As Integer

Dim recipAux As Outlook.Recipient

Dim recipAct As Outlook.Recipient

Dim chivato As String

Try

For i = 1 To SMScontactes.Count

recipAct = SMScontactes.Item(i)

If Not SMScontactes.Item(i).AddressEntry.Members Is Nothing Then

For k = 1 To SMScontactes.Item(i).AddressEntry.Members.Count

recipAux =
SMScontactes.Add(SMScontactes.Item(i).AddressEntry.Members(k).Name)

recipAux.Resolve()

ContactesSMS.Add(recipAux.Name, recipAux.Address, , recipAux.EntryID)
'FAILS <-----------------

Next k

recipAct.Delete()

End If

Next i

Catch ex As Exception

MsgBox("Error a TreureLlistaDis - " & ex.Message & " - " & chivato)

End Try

End Sub
 
D

Dmitry Streblechenko

Do you mean you cannot create it using CreateObject? The only creatable
object in CDO 1.21 is MAPI.Session.
Recipients object can only be retrieved from Message.Recipients and
Session.AddressBook

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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