PR_ATTACH_SIZE

PR_ATTACH_SIZE

Post by cG9wcH » Fri, 10 Feb 2006 13:31:19


Hi,

I have a question regarding the retrieving of this property. I specify an
array of
SizedSPropTagArray that includes PR_ATTACH_SIZE, PR_HASATTACH,
PR_MESSAGE_SIZE and etc... Next, after I done all the HrQueryRow and get all
the messages I want, I noticed that when I retrieve the PR_ATTACH_SIZE, it
gives me a very huge size such as 2147746063. I know this value is not
correct because it is larger than my PR_MESSAGE_SIZE. I have no problem
obtaining PR_MESSAGE_SIZE and PR_HASATTACH. Is there any problem with this
property? I believe the way to retrieve PR_ATTACH_SIZE is the same as
PR_MESSAGE_SIZE. If I can retrieve PR_MESSAGE_SIZE correctly then obtaining
PR_ATTACH_SIZE should be no problem right??

Btw, do I need to an OpenAttach before able to obtain PR_ATTACH_SIZE? I
don't think so. What's your view?

My objective is to filter away the file attachment if it is too huge (i.e.
greater than certain size).

Many thanks!!
 
 
 

PR_ATTACH_SIZE

Post by Dmitry Str » Fri, 10 Feb 2006 14:39:53

2147746063 is 0x8004010F, which is MAPI_E_NOT_FOUND error.
How do you retrieve the property? If the property cannot be retrieved,
MAPI_W_ERRORS_RETURNED is returned by GetProps() and the returned property
is reset to PT_ERROR. SPropValue.Value.err is then set to the appropriate
error.
AFAIK that property is calculated when the attachment and message are saved,
they are not available before that.

Dmitry Streblechenko (MVP)
http://www.yqcomputer.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

 
 
 

PR_ATTACH_SIZE

Post by cG9wcH » Fri, 10 Feb 2006 14:47:26

Hi,

Just to share with you my findings. To my horror, I realised that you need
to do a GetAttachmentTable and then followed by HrQueryRow with appropriate
SizedSPropTagArray before able to get the PR_ATTACH_SIZE. But......why is
that so?? It is not mentioned in SDK (if I remember correctly).

As of what I understand, SDK describes this property as "the sum, in bytes,
of the sizes of all properties on an attachment". I may be wrong to assume
that it returns the total size of all attachments!!! What do you think?

Maybe it is just a single attachment and then by doing HrQueryRow and
retrieve the PR_ATTACH_SIZE you get the size of individual attachment if
there is more than one. Please correct me if I am wrong.

Thanks for your time once again!!
 
 
 

PR_ATTACH_SIZE

Post by cG9wcH » Fri, 10 Feb 2006 15:00:28

Hi,

Btw, I would like to know how do you interpret the error message?

For example 2147746063 is translated to it equivalent HEX value of
0x8004010F. Where do you get the MAPI_E_NOT_FOUND header file inorder to map
0x8004010F to something error message?

If I remember correctly, I ever come across an article that describe
certains bytes of the error message represent certain things but I forgot
where is it.
 
 
 

PR_ATTACH_SIZE

Post by Dmitry Str » Fri, 10 Feb 2006 15:25:15

Most errors are defined in mapicode.h and edkmdb.h.

Dmitry Streblechenko (MVP)
http://www.yqcomputer.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool