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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Retrieve EntryID from CDO 1.21



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 23rd 07, 08:17 PM posted to microsoft.public.outlook.program_vba
laperled@gmail.com
external usenet poster
 
Posts: 2
Default Retrieve EntryID from CDO 1.21

On May 23, 1:28 pm, Eric Legault [MVP - Outlook]
wrote:
The DASL name for the EntryID property is DAV:id!

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:http://www.collaborativeinnovations.ca
Blog:http://blogs.officezealot.com/legault/

" wrote:
Hi guys,


i'm using C# with CDO 1.21 (Exchange dll) and ADODB for listing all
the Personal Contacts of my users and sending that into a database!


I'm using this code for that :


iPerson = new CDO.PersonClass();
iPerson.DataSource.Open(strEmailAddress2, null,
ADODB.ConnectModeEnum.adModeRead,
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
ADODB.RecordOpenOptionsEnum.adOpenSource, String.Empty, String.Empty);
iMailbox =
(CDO.IMailbox)iPerson.GetInterface("IMailbox");


Console.WriteLine(iMailbox.BaseFolder);
ADODB.Connection oCn = new ADODB.Connection();
ADODB.Recordset oRs = new ADODB.Recordset();
ADODB.Fields oFields;
oCn.Provider = "ExOLEDB.Datasource";
oCn.Open(iMailbox.Contacts, "", "", -1);
string strSql;
strSql = "";
strSql = "select ";
strSql = strSql + "\"DAV:href\",
\"urn:schemas:contacts:cn\" ";
strSql = strSql + ", \"http://
schemas.microsoft.com/mapi/id/{00062004-0000-0000-C000-000000000046}/
0x8083\" ";
strSql = strSql + ",
\"urn:schemas:contacts:businesshomepage\" ";
strSql = strSql + ",
\"urn:schemas:contacts:callbackphone\" ";
strSql = strSql + ", \"urn:schemas:contacts:co
\" ";
strSql = strSql + ",
\"urn:schemas:contacts:facsimiletelephonenumber \" ";
strSql = strSql + ",
\"urn:schemas:contacts:homeCity\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homeCountry\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homefax\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homephone2\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homePhone\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homePostaladdress\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homePostalCode\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homepostofficebox\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homeState\" ";
strSql = strSql + ",
\"urn:schemas:contacts:homeStreet\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingcity\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingcountry\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingpostaladdress\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingpostalcode\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingpostofficebox\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingstate\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mailingstreet\" ";
strSql = strSql + ",
\"urn:schemas:contacts:mobile\" ";
strSql = strSql + ",
\"urn:schemas:contactsffice2telephonenumber\" ";
strSql = strSql + ",
\"urn:schemas:contactsfficetelephonenumber\" ";
strSql = strSql + ",
\"urn:schemas:contactsrganizationmainphone\" ";
strSql = strSql + ",
\"urn:schemas:contactsthercity\" ";
strSql = strSql + ",
\"urn:schemas:contactsthercountry\" ";
strSql = strSql + ",
\"urn:schemas:contactstherfax\" ";
strSql = strSql + ",
\"urn:schemas:contactsthermobile\" ";
strSql = strSql + ",
\"urn:schemas:contactstherpager\" ";
strSql = strSql + ",
\"urn:schemas:contactstherpostaladdress\" ";
strSql = strSql + ",
\"urn:schemas:contactstherpostalcode\" ";
strSql = strSql + ",
\"urn:schemas:contactstherpostofficebox\" ";
strSql = strSql + ",
\"urn:schemas:contactstherstate\" ";
strSql = strSql + ",
\"urn:schemas:contactstherstreet\" ";
strSql = strSql + ",
\"urn:schemas:contactstherTelephone\" ";
strSql = strSql + ",
\"urn:schemas:contactsager\" ";
strSql = strSql + ",
\"urn:schemas:contactsostalcode\" ";
strSql = strSql + ",
\"urn:schemas:contactsostofficebox\" ";
strSql = strSql + ",
\"urn:schemas:contactsrofession\" ";
strSql = strSql + ",
\"urn:schemas:contacts:street\" ";
strSql = strSql + ",
\"urn:schemas:contacts:telephoneNumber\" ";
strSql = strSql + ",
\"urn:schemas:contacts:telephonenumber2\" ";
strSql = strSql + ",
\"urn:schemas:contacts:telexnumber\" ";
strSql = strSql + ",
\"urn:schemas:contacts:title\" ";
strSql = strSql + ",
\"urn:schemas:contacts:workaddress\" ";
strSql = strSql + " from scope ('shallow
traversal of " + "\"";
strSql = strSql + iMailbox.Contacts + "\"') ";
oRs.Open(strSql,
oCn, ADODB.CursorTypeEnum.adOpenUnspecified,
ADODB.LockTypeEnum.adLockOptimistic, 1);


This is only a part of the code, but it show you how i do that! The
problem, is that i want the Unique Identifier of that contact!


Is there a way for me to retrieve a unique identifier of the contact?
Thanks a zillion!


Thank you so much!

 




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
Retrieve EntryID from CDO 1.21 laperled@gmail.com Outlook and VBA 1 May 23rd 07 06:28 PM
EntryID Ela Outlook and VBA 2 April 13th 07 12:10 AM
EntryID is nothing donald Add-ins for Outlook 2 March 20th 06 05:08 PM
Invalid EntryID KatTheBird Outlook - Using Contacts 0 March 7th 06 06:45 AM
EntryID Arne Baldauf Outlook and VBA 3 February 4th 06 05:41 PM


All times are GMT +1. The time now is 03:25 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.