D
David Cebrian
Hello again everybody,
I have a problem with CDO, I use the Addressbook method to search in the
contacts, stored in outlook or exhange, to select someones, when they are
selecteds I want to obtain the telephone number, when the contact is stored
in outlook, no problem I know how i do, but the problem is when i select a
contact from exchange.
I am a VB.NET programmer, and my project is an Add-in for Outlook.
This is the code:
SMScontactes = New Collection
' start CDO session
m_CDO.Logon("outlook", , False, False)
' show address book
CDOrecips = CType(m_CDO.AddressBook(, "Seleccione los Destinatarios del
SMS", , , 1, "Destinatarios", , ), MAPI.Recipients)
For n = 1 To CType(CDOrecips.Count, Integer)
CDOrecip = CType(CDOrecips.Item(n), MAPI.Recipient)
strID = CType(CDOrecip.ID, String)
strID = Microsoft.VisualBasic.Strings.Right(strID, Len(strID) - 72)
strID = Microsoft.VisualBasic.Strings.Left(strID, Len(strID) - 6)
contacte = CType(apli.GetNamespace("mapi").GetItemFromID(strID),
Outlook.ContactItem)
If Not contacte Is Nothing Then
SMScontactes.Add(contacte)
txtPara.Text = txtPara.Text & contacte.FullName & "(" &
contacte.MobileTelephoneNumber & ");"
Else
MsgBox("No es un contacto de Outlook")
End If
Next
' release objects
m_CDO.Logoff()
Thanks in advance.
Jaume F.
I have a problem with CDO, I use the Addressbook method to search in the
contacts, stored in outlook or exhange, to select someones, when they are
selecteds I want to obtain the telephone number, when the contact is stored
in outlook, no problem I know how i do, but the problem is when i select a
contact from exchange.
I am a VB.NET programmer, and my project is an Add-in for Outlook.
This is the code:
SMScontactes = New Collection
' start CDO session
m_CDO.Logon("outlook", , False, False)
' show address book
CDOrecips = CType(m_CDO.AddressBook(, "Seleccione los Destinatarios del
SMS", , , 1, "Destinatarios", , ), MAPI.Recipients)
For n = 1 To CType(CDOrecips.Count, Integer)
CDOrecip = CType(CDOrecips.Item(n), MAPI.Recipient)
strID = CType(CDOrecip.ID, String)
strID = Microsoft.VisualBasic.Strings.Right(strID, Len(strID) - 72)
strID = Microsoft.VisualBasic.Strings.Left(strID, Len(strID) - 6)
contacte = CType(apli.GetNamespace("mapi").GetItemFromID(strID),
Outlook.ContactItem)
If Not contacte Is Nothing Then
SMScontactes.Add(contacte)
txtPara.Text = txtPara.Text & contacte.FullName & "(" &
contacte.MobileTelephoneNumber & ");"
Else
MsgBox("No es un contacto de Outlook")
End If
Next
' release objects
m_CDO.Logoff()
Thanks in advance.
Jaume F.