embeded image change

A

Ashish

Hi,

In my outlook addin, I send a mail and copy an image in its body. After mail
received we see embeded image in body in outlook window. When i open this
mail i add an attachment(text type) in the mail and display it. After adding
attachment then embeded image change to blank image. Why it change to blank
image? WHich property is changed after adding attachment. Should i reset any
property of mail after adding attachment.
 
K

Ken Slovak - [MVP - Outlook]

Just adding another attachment will not modify another attachment, embedded
or not. You must be doing something to corrupt that embedded image or the
attachment.
 
A

Ashish

Yes when i open that mail, i change its subject and save it.
Is that change the embeded image. I save it like
Outlook::_MailOtemPtr ptr = inspector->currentitem;
ptr->put_Subject(new subject);
ptr->Save();
I call save function because this trigger to property change(of this mail)
event.
What should i do?
 
A

Ashish

I remove the code to set subject. But still embeded image is not visible
when open mail. Now i'm sure it happens due to adding an attachment. If i
dont add attachment then embeded image is visible. Attachment is a text
file. I use following code to add attachment

variant_t vpath(attachfile_path.c_str());

variant_t vposition( 1);

variant_t vdisplay(attachfilename);

variant_t filetype((long)1);

((Outlook::_MailItemPtr)MailItemptr)->Attachments->Add(vpath,filetype,vposition,vdisplay);
 
K

Ken Slovak - [MVP - Outlook]

What BodyFormat is the message in? Have you tried supplying a
missing/default argument for the Position argument (not sure how that would
be done using C++).
 
A

Ashish

I dont check the body format. In my addin when i open a mail i just add one
attachment to it. what is missing/default argument for the Position argument
? where we need to pass it?
When i add an attachment then i pass attachment position.
 
A

Ashish

When open mail then first i check all attachments in this mail.
Mail->Attachments->Count = 0. Embeded image is in body of mail
Then i add an attachment. After adding attachment i cant see embeded image
in mail body. But when i close this mail Mail->Attachments->Count shows
value 2. It means when i add an attachment embeded image is converted into
attachment(by val). But it doesn't show that attachment.
What's wrong here why embeded image change into attachment. Is there any
solution for this case.
 
K

Ken Slovak - [MVP - Outlook]

What is wrong is the Count == 0 return. Any embedded image is an attachment,
how else would it be included in the message? An embedded attachment will
have certain properties set on it that are different than an "attached"
attachment, but it's still attached to the message.

Is the item you are opening saved before you check for attachments count?
That's important. Also important is the Outlook version and body format. For
example in some cases an embedded attachment such as ClipArt will actually
show up as 2 attachments, one is the content and the other is a WMV wrapper.
 
A

Ashish

What is wrong is the Count == 0 return. Any >embedded image is an
attachment,
when i open mail which contains embeded attachments i check
Mail->Attachments->Count value and it returns 0.
I check this in Item_Open() event.
So in this case attachment for embeded image is not attached to message.
Either it's in body or i dont have more idea where it is.

Is the item you are opening saved before you check for attachments count?
I send a new mail with embeded image. After mail is received i open the
mail. Before opening this mail i dont save it.

I dont touch body format for this mail.
Is there any example for embeded image available?
 
K

Ken Slovak - [MVP - Outlook]

I don't care how or where it's opened or how it's done, all embedded images
are attachments on the item. Period.

It may be a hidden attachment, where if the property is set it doesn't show
the paperclip icon on the item, but it's still an attachment.

There are lots of different samples available for embedded attachments,
search on Google and at www.outlookcode.com for some.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top