|
|
|
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?
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
|
|