PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Recipients Objects

Reply

Recipients Objects

 
Thread Tools Rate Thread
Old 16-03-2006, 05:37 PM   #1
David Cebrian
Guest
 
Posts: n/a
Default Recipients Objects


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




  Reply With Quote
Old 16-03-2006, 09:05 PM   #2
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Recipients Objects

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

"David Cebrian" <david_cebrian@msn.com> wrote in message
news:OG0X%23$RSGHA.336@TK2MSFTNGP12.phx.gbl...
> 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
>
>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off