Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Wed, 18 Jun 2008 15:08:23 -0700 (PDT),    group: microsoft.public.platformsdk.mapi        back       


Contacts created in MAPI not saving correctly?   
Hi,
I am using MAPI to create contacts and distribution lists in the
contacts folder of Outlook. I have been able to successfully create
contacts and distribution lists, and display them, however I am having
some strange issues.

1. After creating a contact, it shows up fine in outlook. When I open
the contact, all of the fields that I have set are displayed with the
correct values. However, if I close the contact Outlook will ask if I
want to save it even though I have not made any changes.

2. After creating a distribution list, I cannot double click on any of
the contacts that have been created inside of that distribution list.
If I modify anything (i.e. the name of the distribution list, or add a
note) and then save the distribution list, it works correctly (I can
double click on a contact and it will open the corresponding entry).
I'll bet if I can fix #1, it will hint me at a fix for this too.

3. If one of the contacts that's been added to the distribution list
was created through my MAPI code, Outlook cannot open that contact
from the distribution list UNTIL I have opened it from the contact
list and re-saved it. I'm sure if I fix #1, it will fix this.

Has anyone seen any of these behaviors before? Is there a field I did
not fill in that would cause this behavior? A field that could be
filled incorrectly?

I see this issue on Outlook 2007 & 2003.

Here is some pseudo code for what I'm doing.
msgStore = getMsgStore();
folder = getContactsFolder();
folder->CreateMessage(&IID_IMAPIProp, 0, &contact);

//Build an array of SPropValue - properties include name, message
class, etc.)
contact->SetProps(propertiesSize, properties, NULL);
contact->Save();
date: Wed, 18 Jun 2008 15:08:23 -0700 (PDT)   author:   Nick Ratelle

Re: Contacts created in MAPI not saving correctly?   
On Jun 18, 6:08 pm, Nick  Ratelle  wrote:
> 1. After creating a contact, it shows up fine in outlook. When I open
> the contact, all of the fields that I have set are displayed with the
> correct values. However, if I close the contact Outlook will ask if I
> want to save it even though I have not made any changes.

I have figured out this part. For any e-mail address that you create,
you also need to create a one off entry for it...
date: Wed, 18 Jun 2008 15:54:01 -0700 (PDT)   author:   Nick Ratelle

Re: Contacts created in MAPI not saving correctly?   
2. Have you tried to compare the good and bad DL created by Outlook and your 
code?

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Nick Ratelle"  wrote in message 
news:720fb1f4-8e66-4405-91fd-8f0a3a7d9a5e@i76g2000hsf.googlegroups.com...
> Hi,
> I am using MAPI to create contacts and distribution lists in the
> contacts folder of Outlook. I have been able to successfully create
> contacts and distribution lists, and display them, however I am having
> some strange issues.
>
> 1. After creating a contact, it shows up fine in outlook. When I open
> the contact, all of the fields that I have set are displayed with the
> correct values. However, if I close the contact Outlook will ask if I
> want to save it even though I have not made any changes.
>
> 2. After creating a distribution list, I cannot double click on any of
> the contacts that have been created inside of that distribution list.
> If I modify anything (i.e. the name of the distribution list, or add a
> note) and then save the distribution list, it works correctly (I can
> double click on a contact and it will open the corresponding entry).
> I'll bet if I can fix #1, it will hint me at a fix for this too.
>
> 3. If one of the contacts that's been added to the distribution list
> was created through my MAPI code, Outlook cannot open that contact
> from the distribution list UNTIL I have opened it from the contact
> list and re-saved it. I'm sure if I fix #1, it will fix this.
>
> Has anyone seen any of these behaviors before? Is there a field I did
> not fill in that would cause this behavior? A field that could be
> filled incorrectly?
>
> I see this issue on Outlook 2007 & 2003.
>
> Here is some pseudo code for what I'm doing.
> msgStore = getMsgStore();
> folder = getContactsFolder();
> folder->CreateMessage(&IID_IMAPIProp, 0, &contact);
>
> //Build an array of SPropValue - properties include name, message
> class, etc.)
> contact->SetProps(propertiesSize, properties, NULL);
> contact->Save();
date: Wed, 18 Jun 2008 16:13:06 -0700   author:   Dmitry Streblechenko

Re: Contacts created in MAPI not saving correctly?   
BTW - this would have helped you:
http://blogs.msdn.com/stephen_griffin/archive/2008/06/11/mfcmapi-does-contacts.aspx

"Nick Ratelle"  wrote in message 
news:d73a2fd0-c747-4b55-b99c-f5389a2a7f82@m73g2000hsh.googlegroups.com...
On Jun 18, 6:08 pm, Nick  Ratelle  wrote:
> 1. After creating a contact, it shows up fine in outlook. When I open
> the contact, all of the fields that I have set are displayed with the
> correct values. However, if I close the contact Outlook will ask if I
> want to save it even though I have not made any changes.

I have figured out this part. For any e-mail address that you create,
you also need to create a one off entry for it...
date: Thu, 19 Jun 2008 09:02:24 -0400   author:   Stephen Griffin

Re: Contacts created in MAPI not saving correctly?   
On Jun 18, 7:13 pm, "Dmitry Streblechenko"  wrote:
> 2. Have you tried to compare the good and bad DL created by Outlook and your
> code?
>
> --
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
> -"Nick Ratelle"  wrote in message
>

I have but it didn't immediately help until I noticed the size of the
EntryIds stored in the Members blobs was different in the distribution
list created by outlook. I didn't realize one was required to wrap the
EntryId. I read "Contact Object Protocol Specification" at
http://msdn.microsoft.com/en-us/library/cc463907(EXCHG.80).aspx which
explained everything fairly well.

Also, to Stephen, thanks for the pointer to MFC MAPI. I will be
working with other Outlook features soon and I'm sure that having this
resource will be to my advantage.
date: Thu, 19 Jun 2008 15:10:01 -0700 (PDT)   author:   Nick Ratelle

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us