Outlook 2007 AddIn: Filter attachments by type

  • Thread starter Derick Swart
  • Start date Views 2,361
D

Derick Swart

Good day,

I have an Outlook 2007 AddIn that posts attachments to a document server.

The issue that that not only "real" attachments are posted, but also

signatures and other images that are attached. Is there a way to filters

these out?

Thanks,

Derick
 
K

Ken Slovak - [MVP - Outlook]

You will have to use the PropertyAccessor object on each attachment to look

for properties not exposed to the object model to be sure. One property to

look at is AttachmentType, if that is 6 (ATTACH_OLE) then it's an embedded

attachment. If that's not 6 however it still could be an embedded

attachment. It could be 1 (ATTACH_BY_VALUE) and still could be embedded.

So, you have to check for PR_ATTACH_CONTENT_ID and see if it's there. If it

is there it's an embedded attachment. When you get the PropertyAccessor

object use its GetProperty() method with the following DASL string property

tag: "urn:schemas:mailheader:content-id"

"Derick Swart" <derick@connexity.co.za> wrote in message

news:D348212B-9488-4C78-AA7F-B1F8CA241028@microsoft.com...
> Good day,

> I have an Outlook 2007 AddIn that posts attachments to a document server.
> The issue that that not only "real" attachments are posted, but also
> signatures and other images that are attached. Is there a way to filters
> these out?

> Thanks,
> Derick
 
D

Derick Swart

Hectic!

Thanks Ken.
<kenslovak@mvps.org> wrote in message

news:OuWnonyoJHA.6096@TK2MSFTNGP02.phx.gbl...
> You will have to use the PropertyAccessor object on each attachment to
> look for properties not exposed to the object model to be sure. One
> property to look at is AttachmentType, if that is 6 (ATTACH_OLE) then it's
> an embedded attachment. If that's not 6 however it still could be an
> embedded attachment. It could be 1 (ATTACH_BY_VALUE) and still could be
> embedded.

> So, you have to check for PR_ATTACH_CONTENT_ID and see if it's there. If
> it is there it's an embedded attachment. When you get the PropertyAccessor
> object use its GetProperty() method with the following DASL string
> property tag: "urn:schemas:mailheader:content-id"

> >

>

> "Derick Swart" <derick@connexity.co.za> wrote in message
> news:D348212B-9488-4C78-AA7F-B1F8CA241028@microsoft.com...
> > Good day,
>

>> I have an Outlook 2007 AddIn that posts attachments to a document server.
> > The issue that that not only "real" attachments are posted, but also
> > signatures and other images that are attached. Is there a way to filters
> > these out?
>

>> Thanks,
> > Derick

>
 

Top