![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
That folder must be used by OAB for the name resolution to work - set the
MAPIFolder.ShowAsOutlookAB property to true. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "cbukeo" u59160@uwe wrote in message news:a618b6a00eac0@uwe... Hello All, I am developing an Outlook 2007 addin using VisualStudio 2008 and C#. My goal is to create a distList inside a contacts folder which is not the default contacts folder. When I say "default contacts folder" I refer to the one inside "Personal Folders". I successfully create the distribution list and add members to it. However I am not able to resolve the contact and as a result the member name shows same as the member e-mail address. When I investigate this using redemption I noticed that there is a high level "IAddrBook" button which brings up a list of the contacts inside default contacts folder. And then there is a "IMAPIFolder" button which brings up a dialog box with many tabs. One of these tabs is "GetContentsTable" which lists the contacts that are not resolved correctly. I believe I have spotted the problem but I could not figure out how I can tell outlook object model to resolve the distList members from the "IMAPIFolder". My code looks like this (a bit simplified): using Outlook = Microsoft.Office.Interop.Outlook; Outlook.Folder olFolder = olParentFolder.Folders.Add("AContactFolder", OlDefaultFolders.olFolderContacts); Outlook.DistListItem olDistList = olFolder.Items.Add(OlItemType. olDistributionListItem); Outlook.Recipient olRecipient = olFolder.Session.CreateRecipient(emailAddress) ; foreach(emailAddress in emailAddressList) { if(olRecipient.Resolve()) { olDistList.AddMember; } } Thanks in advance |
#2
|
|||
|
|||
![]()
Thanks Dmitry,
Your suggestion and creating the distlist member with the name (instead of e- mail address) solved the problem! For the benefit of the community fix is: using Outlook = Microsoft.Office.Interop.Outlook; Outlook.Folder olFolder = olParentFolder.Folders.Add("AContactFolder", OlDefaultFolders.olFolderContacts); olFolder.ShowAsOutlookAB = true; Outlook.DistListItem olDistList = olFolder.Items.Add(OlItemType. olDistributionListItem); foreach(contactName in contactNameList) { Outlook.Recipient olRecipient = olFolder.Session.CreateRecipient (contactName); if(olRecipient.Resolve()) { olDistList.AddMember; } } -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...ddins/201004/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Default Search Contact folder | Mal Reeve | Outlook - Calandaring | 1 | December 12th 06 02:12 AM |
how to set some contact folder as default | Johny | Outlook - Using Forms | 1 | September 4th 06 12:54 AM |
Change default Contact folder | Holo20 | Outlook - Using Contacts | 4 | August 1st 06 12:39 AM |
How do i change default contact folder | Darrin | Outlook - Using Contacts | 1 | July 28th 06 08:49 PM |
Contact list as default folder | Orcas2369 | Outlook - Using Contacts | 3 | April 14th 06 10:13 AM |