No Attachments but still...

Add-in Express™ Support Service
That's what is more important than anything else

No Attachments but still...
 
H Philip




Posts: 17
Joined: 2005-01-14
I have a problem detecting a MailItem attachments.
Somehow MailItem.Attachments.Count does not return 0 even if there is no attachment at all. I digged deeper and I found that image sources within the message source are considered attachments ie <IMG SRC='....>
Is there a way to retrieve only "real" file attachments?
Posted 07 Feb, 2005 04:26:13 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Philip,

I think analizing the FileName, Position and Type properties of the Attachment interface you will be able to distinguish embedded attachments from "real" file attachments.
Posted 07 Feb, 2005 06:43:15 Top
H Philip




Posts: 17
Joined: 2005-01-14
Well I checked that already, the Position returns always 0 and the Type_ value can't be distinguished from embeded to "real" files.

The code goes like that:

Var
AT: Attachment;
IMail: MailItem;
I, nCount, nPos: Integer;
nType: LongWord;
begin

... MailItem := ...

nCount := MailItem.Attachments.Count;

For I := 1 To nCount Do
Begin
AT := MailItem.Attachments.Item(I);
nType := AT.type_;
nPos := AT.Position;
ShowMessage(Format(FileName: %s, Type: %d, Position: %d'),[AT.FileName,nType,nPos));
End;

Should I do it in another way?

Posted 07 Feb, 2005 10:32:05 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Philip,

I have just found the code sample on OutlookCode.com:
http://www.outlookcode.com/codedetail.aspx?id=52

The idea is to check the Context-ID (CID) of an attachment. If it is present then the attachment is embedded. I converted that sample code to Delphi and it seems to work.
Posted 08 Feb, 2005 07:33:05 Top
H Philip




Posts: 17
Joined: 2005-01-14
Hi Dmitry,

Thanks for your reply.
I can't find the CID or Fields property for an attachment.
Can you please post the Delphi example ?

Posted 09 Feb, 2005 03:17:10 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Philip,

I am afraid I can't because we provide such kind of support for Premium Subscribers only.

Posted 09 Feb, 2005 06:35:17 Top
Philip H




Posts: 1
Joined: 2005-02-09
Fair enough... I tried to purshase it - can't find how :-)
Posted 09 Feb, 2005 12:58:34 Top
Eugene Starostin


ADX Team
Add-in Express team


Posts: 430
Joined: 2004-04-05
Hi Philip,

Have a look at "Add-in Express 2 VCL Edition & Premium Support Service Subscription" on our order page
Posted 09 Feb, 2005 13:08:30 Top