Adding a Picture to a contact in OL2003 using c++
- From: "Ro" <ronank@xxxxxxxxx>
- Date: 26 Sep 2005 07:08:43 -0700
Hi,
A few searches of the group hasn't shown an answer for this so
apologies if it's been asked before.
What I want to do:
Add, read, remove, modify a picture in a contact in OL2003.
What I can do:
read, remove (sort of) and modify a picture through MAPI. The picture
is stored as an attachment, so I can read it by opening the attachment
table, and read the binary data. I can remove it by calling
DeleteAttach, and I can modify it by replacing the binary data in the
attachment.
What I can't do (so far):
Add a new picture or completly remove the picture.
If I attempt to add a new picture, I can create the attachment, and
specify all values for the picture (based on an existing picture). It
doesn't show up in Outlook though. If I look in OutlookSpy, the
Attachment seems fine. Looking at just the IMessage both (one with a
manually added picture, and one with my attempted add) seem pretty much
the same. The main difference between two contacts is in the
CurrentItem where HasPicture is still false for the contact with the
attempted add. Now according to the OOM, this is a read-only property,
so I can't set it directly with MAPI. This, I believe, gets set
through the call to AddPicture, but I don't think I can call that
directly from C++. Is there a way of calling AddPicture? I'd like to
call RemovePicture as well, as deleting the attachment doesn't reset
the HasPicture flag either, and I don't want to leave the contact in an
unsafe state.
Has anyone out there done this with C++? Any pointers on how to call
these two functions? Is there any example code out there?
Thanks in advance,
Ro.
.
- Follow-Ups:
- Re: Adding a Picture to a contact in OL2003 using c++
- From: Dmitry Streblechenko
- Re: Adding a Picture to a contact in OL2003 using c++
- Prev by Date: Re: OpenMsgStore returning MAPI_E_UNCONFIGURED
- Next by Date: Re: Is there a sample MAPI Spooler
- Previous by thread: Re: Is there a sample MAPI Spooler
- Next by thread: Re: Adding a Picture to a contact in OL2003 using c++
- Index(es):