A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Exchange contact in outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 2nd 06, 01:01 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
David Cebrian
external usenet poster
 
Posts: 15
Default Exchange contact in outlook

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(strI D),
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.


Ads
  #2  
Old March 2nd 06, 01:38 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Exchange contact in outlook

You'd need to use the appropriate MAPI property tag with the CDO AddressEntry.FIelds collection. See http://www.cdolive.com/cdo10.htm. I have a Redemption sample at http://www.outlookcode.com/codedetail.aspx?id=594 as well, if you want to avoid security prompts.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message ...
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(strI D),
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.


  #3  
Old March 2nd 06, 07:10 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
David Cebrian
external usenet poster
 
Posts: 15
Default Exchange contact in outlook

Hello Sue,

But if I want to use the recipient object of an email or an appointment
item, then the example don't run. Because the objects recipient from outlook
are different to the object repient of the CDO, and the property Fields
don't exists in the object recipient of outlook.

How can I resolve this ?

Thank you, for your time.

Jaume F.

"Sue Mosher [MVP-Outlook]" escribió en el mensaje
...
You'd need to use the appropriate MAPI property tag with the CDO
AddressEntry.FIelds collection. See http://www.cdolive.com/cdo10.htm. I have
a Redemption sample at http://www.outlookcode.com/codedetail.aspx?id=594 as
well, if you want to avoid security prompts.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message
...
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(strI D),
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.




  #4  
Old March 2nd 06, 07:19 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Exchange contact in outlook

You still have to use CDO. You can get the item's EntryID and StoreID from Outlook and then use them with the Session.GetItem method to get the corresponding item with CDO.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message ...
Hello Sue,

But if I want to use the recipient object of an email or an appointment
item, then the example don't run. Because the objects recipient from outlook
are different to the object repient of the CDO, and the property Fields
don't exists in the object recipient of outlook.



"Sue Mosher [MVP-Outlook]" escribió en el mensaje
...
You'd need to use the appropriate MAPI property tag with the CDO
AddressEntry.FIelds collection. See http://www.cdolive.com/cdo10.htm. I have
a Redemption sample at http://www.outlookcode.com/codedetail.aspx?id=594 as
well, if you want to avoid security prompts.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message
...
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(strI D),
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.




  #5  
Old March 2nd 06, 07:25 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
Dan Mitchell
external usenet poster
 
Posts: 58
Default Exchange contact in outlook

"David Cebrian" wrote in
:
I have a problem with CDO, [...]

I am a VB.NET programmer, and my project is an Add-in for Outlook.


You should also know that CDO1.21 and Outlook officially won't work
together:

http://support.microsoft.com/kb/813349

Also, as the problems that arise are generally threading/memory
management mismatches, running this as an Outlook add-in is going to
make it even more complicated to work out what's going on. Quoting from
a post from an MS guy a while back:

"It's the sort of thing that'll mostly work. It'll work while you're
writing it. Then it'll work while you're testing it. It'll work while
your customer is evaluating it. Then as soon as the customer deploys it
- BAM! That's when it'll decide to start having problems. And Microsoft
ain't gonna help you with it, since we told you not to do it in the
first place. "

So you might get away with this, but I wouldn't want to rely on it.

-- dan
  #6  
Old March 2nd 06, 07:58 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Exchange contact in outlook

Exactly. That's why I'd use Redemption instead if I were doing a .NET project.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Dan Mitchell" wrote in message 8.16...
"David Cebrian" wrote in
:
I have a problem with CDO, [...]

I am a VB.NET programmer, and my project is an Add-in for Outlook.


You should also know that CDO1.21 and Outlook officially won't work
together:

http://support.microsoft.com/kb/813349

Also, as the problems that arise are generally threading/memory
management mismatches, running this as an Outlook add-in is going to
make it even more complicated to work out what's going on. Quoting from
a post from an MS guy a while back:

"It's the sort of thing that'll mostly work. It'll work while you're
writing it. Then it'll work while you're testing it. It'll work while
your customer is evaluating it. Then as soon as the customer deploys it
- BAM! That's when it'll decide to start having problems. And Microsoft
ain't gonna help you with it, since we told you not to do it in the
first place. "

So you might get away with this, but I wouldn't want to rely on it.

-- dan

  #7  
Old March 2nd 06, 11:47 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
Dan Mitchell
external usenet poster
 
Posts: 58
Default Exchange contact in outlook

Dan Mitchell wrote in
8.16:
You should also know that CDO1.21 and Outlook officially won't work
together:


Significant correction: I meant to say "CDO1.21 and .Net officially won't
work together", not CDO1.21 and Outlook. Those are fine. Sorry for any
confusion.

http://support.microsoft.com/kb/813349


-- dan
  #8  
Old March 3rd 06, 02:47 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
David Cebrian
external usenet poster
 
Posts: 15
Default Exchange contact in outlook

Thank you very much!!!

Where can i obtain more information about Redemtion? And how can i include
this dll in my projects?



"Sue Mosher [MVP-Outlook]" escribió en el mensaje
...
You still have to use CDO. You can get the item's EntryID and StoreID from
Outlook and then use them with the Session.GetItem method to get the
corresponding item with CDO.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message
...
Hello Sue,

But if I want to use the recipient object of an email or an appointment
item, then the example don't run. Because the objects recipient from

outlook
are different to the object repient of the CDO, and the property Fields
don't exists in the object recipient of outlook.



"Sue Mosher [MVP-Outlook]" escribió en el mensaje
...
You'd need to use the appropriate MAPI property tag with the CDO
AddressEntry.FIelds collection. See http://www.cdolive.com/cdo10.htm. I

have
a Redemption sample at http://www.outlookcode.com/codedetail.aspx?id=594

as
well, if you want to avoid security prompts.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message
...
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(strI D),
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.






  #9  
Old March 3rd 06, 02:56 PM posted to microsoft.public.outlook.program_addins,microsoft.public.exchange.development,microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Exchange contact in outlook

See http://www.dimastr.com/redemption/. It comes as a redistributable version you can include with your project's setup files.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"David Cebrian" wrote in message ...
Thank you very much!!!

Where can i obtain more information about Redemtion? And how can i include
this dll in my projects?



"Sue Mosher [MVP-Outlook]" escribió en el mensaje
...
You still have to use CDO. You can get the item's EntryID and StoreID from
Outlook and then use them with the Session.GetItem method to get the
corresponding item with CDO.

"David Cebrian" wrote in message
...
Hello Sue,

But if I want to use the recipient object of an email or an appointment
item, then the example don't run. Because the objects recipient from

outlook
are different to the object repient of the CDO, and the property Fields
don't exists in the object recipient of outlook.



"Sue Mosher [MVP-Outlook]" escribió en el mensaje
...
You'd need to use the appropriate MAPI property tag with the CDO
AddressEntry.FIelds collection. See http://www.cdolive.com/cdo10.htm. I

have
a Redemption sample at http://www.outlookcode.com/codedetail.aspx?id=594

as
well, if you want to avoid security prompts.


"David Cebrian" wrote in message
...
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(strI D),
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()


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook using wrong address from Exchange contact when sending via Rick Voland Outlook - Installation 3 February 24th 06 12:13 AM
I need to save a contact in SMTP format not exchange format. JAX Outlook - Using Contacts 0 February 15th 06 02:51 PM
Outlook-Exchange Synchronization Dan Outlook - Installation 1 February 2nd 06 03:33 AM
Popup with Outlook Exchange Sam Outlook - Installation 0 February 1st 06 06:41 PM
Import Contact Data for certain fields only - update not replace entire contact Pennycook Outlook - Using Contacts 4 January 19th 06 07:07 AM


All times are GMT +1. The time now is 10:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.