A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Trying to hide inline attachments



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 12th 08, 10:47 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 3
Default Trying to hide inline attachments

I am writing some code to archive mail.
whel looping through my selection i check every e-mail to see if it
contains any attachments. However the outlook api gives me a number of
inline attachments that i don't want to see. I only want to see the
attachments that are visible via the paperclip icon in office.

Does anybody now of a way of detecting these inline attachments.

I tried to look at the attachment.type property, but this is not the
way to go.
I tried analysing the htmlbody to look for the filename, but this was
also no help.

TIA

Otto
Ads
  #2  
Old February 13th 08, 06:10 AM posted to microsoft.public.outlook.program_addins
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Trying to hide inline attachments



For embedded attachments, you don't find the file name but something like
this in html:

img src='cid:xxxxx'

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Tue, 12 Feb 2008 02:47:44 -0800 (PST) schrieb :

I am writing some code to archive mail.
whel looping through my selection i check every e-mail to see if it
contains any attachments. However the outlook api gives me a number of
inline attachments that i don't want to see. I only want to see the
attachments that are visible via the paperclip icon in office.

Does anybody now of a way of detecting these inline attachments.

I tried to look at the attachment.type property, but this is not the
way to go.
I tried analysing the htmlbody to look for the filename, but this was
also no help.

TIA

Otto

  #3  
Old February 13th 08, 03:01 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Trying to hide inline attachments

And the cid will be the same as in the PR_ATTACH_CONTENT_ID (0x3712001E or
urn:schemas:mailheader:content-id) property on the attachment object. That
will give you what to look for if you you're using Outlook 2007 or Extended
MAPI or CDO 1.21 or some other API that allows access to properties not
exposed in the Outlook 2003 or earlier object models.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Michael Bauer [MVP - Outlook]" wrote in message
...


For embedded attachments, you don't find the file name but something like
this in html:

img src='cid:xxxxx'

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6


  #4  
Old February 14th 08, 11:50 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 3
Default Trying to hide inline attachments

Unfortunatly, my problem can't be solved in managed code (see
following link for a quote)
http://forums.microsoft.com/MSDN/Sho...72308&SiteID=1

unfortunatly we had to make some consessions in the features of the
application due to the short development time (have to deliver the
software tomorrow)
If i find a solution in managed code, i will post it here.

Thnxs for the pointers however !
  #5  
Old February 21st 08, 10:44 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 3
Default Trying to hide inline attachments

This worked for me (don't mid the sloppy code.... cleaners are on
their way ):

public static bool IsValidAttachment(Outlook.MailItem
mailitem, Outlook.Attachment attachment)
{
bool retval = false;
string CID = "";

try
{
if (attachment.FileName != "")
{
// this skips the olOLE types

MAPI.Session session = new Session();
session.Logon("", "", false, false, Type.Missing,
Type.Missing, Type.Missing);
MAPI.Message message =
(MAPI.Message)session.GetMessage(mailitem.EntryID, "");
MAPI.Attachments atts =
(Attachments)message.Attachments;


for (int teller = 0; teller
mailitem.Attachments.Count; teller++)
{
MAPI.Attachment att =
(MAPI.Attachment)atts.get_Item(teller+1);


MAPI.Fields fields = (MAPI.Fields)att.Fields;
MAPI.Field field =
(MAPI.Field)fields.get_Item(MAPI.CdoPropTags.CdoPR _ATTACH_FILENAME,
null);

if ((string)field.Value ==
attachment.FileName)
{
field =
(MAPI.Field)fields.get_Item(0x3712001F, null);
CID = (string)field.Value;

field =
(MAPI.Field)fields.get_Item(0x37140003, null);


if (!CID.StartsWith(attachment.FileName)
&& (int)field.Value !=4)
retval = true;
}
}
session.Logoff();
}
}
catch
{

}

if (attachment.Type ==
Microsoft.Office.Interop.Outlook.OlAttachmentType. olByValue && CID ==
"")
retval = true;

return retval;
}
  #6  
Old March 25th 10, 11:22 AM posted to microsoft.public.outlook.program_addins
Rick McMullan
external usenet poster
 
Posts: 1
Default Detecting Inline Attachments

Exactly what I was looking for and so obscure! Thanks so much for posting this.

The problem with detecting inline attachments seems only to occur when using HTML mail. The RTF setting doesn't seem to create them.



krach.ara wrote:

This worked for me (don't mid the sloppy code....
23-Feb-08

This worked for me (don't mid the sloppy code.... cleaners are on
their way ):

public static bool IsValidAttachment(Outlook.MailItem
mailitem, Outlook.Attachment attachment)
{
bool retval = false;
string CID = "";

try
{
if (attachment.FileName != "")
{
// this skips the olOLE types

MAPI.Session session = new Session();
session.Logon("", "", false, false, Type.Missing,
Type.Missing, Type.Missing);
MAPI.Message message =
(MAPI.Message)session.GetMessage(mailitem.EntryID, "");
MAPI.Attachments atts =
(Attachments)message.Attachments;


for (int teller = 0; teller
mailitem.Attachments.Count; teller++)
{
MAPI.Attachment att =
(MAPI.Attachment)atts.get_Item(teller+1);


MAPI.Fields fields = (MAPI.Fields)att.Fields;
MAPI.Field field =
(MAPI.Field)fields.get_Item(MAPI.CdoPropTags.CdoPR _ATTACH_FILENAME,
null);

if ((string)field.Value ==
attachment.FileName)
{
field =
(MAPI.Field)fields.get_Item(0x3712001F, null);
CID = (string)field.Value;

field =
(MAPI.Field)fields.get_Item(0x37140003, null);


if (!CID.StartsWith(attachment.FileName)
&& (int)field.Value !=4)
retval = true;
}
}
session.Logoff();
}
}
catch
{

}

if (attachment.Type ==
Microsoft.Office.Interop.Outlook.OlAttachmentType. olByValue && CID ==
"")
retval = true;

return retval;
}

Previous Posts In This Thread:

On Wednesday, February 13, 2008 1:10 AM
Michael Bauer [MVP - Outlook] wrote:

For embedded attachments, you don't find the file name but something likethis
For embedded attachments, you don't find the file name but something like
this in html:

img src='cid:xxxxx'

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Tue, 12 Feb 2008 02:47:44 -0800 (PST) schrieb :

On Wednesday, February 13, 2008 2:48 AM
krach.ara wrote:

Trying to hide inline attachments
I am writing some code to archive mail.
whel looping through my selection i check every e-mail to see if it
contains any attachments. However the outlook api gives me a number of
inline attachments that i don't want to see. I only want to see the
attachments that are visible via the paperclip icon in office.

Does anybody now of a way of detecting these inline attachments.

I tried to look at the attachment.type property, but this is not the
way to go.
I tried analysing the htmlbody to look for the filename, but this was
also no help.

TIA

Otto

On Wednesday, February 13, 2008 10:01 AM
Ken Slovak - [MVP - Outlook] wrote:

And the cid will be the same as in the PR_ATTACH_CONTENT_ID (0x3712001E or
And the cid will be the same as in the PR_ATTACH_CONTENT_ID (0x3712001E or
urn:schemas:mailheader:content-id) property on the attachment object. That
will give you what to look for if you you're using Outlook 2007 or Extended
MAPI or CDO 1.21 or some other API that allows access to properties not
exposed in the Outlook 2003 or earlier object models.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Michael Bauer [MVP - Outlook]" wrote in message
...

On Friday, February 15, 2008 10:02 PM
krach.ara wrote:

Unfortunatly, my problem can't be solved in managed code (seefollowing link
Unfortunatly, my problem can't be solved in managed code (see
following link for a quote)
http://forums.microsoft.com/MSDN/Sho...72308&SiteID=1

unfortunatly we had to make some consessions in the features of the
application due to the short development time (have to deliver the
software tomorrow)
If i find a solution in managed code, i will post it here.

Thnxs for the pointers however !

On Saturday, February 23, 2008 10:31 AM
krach.ara wrote:

This worked for me (don't mid the sloppy code....
This worked for me (don't mid the sloppy code.... cleaners are on
their way ):

public static bool IsValidAttachment(Outlook.MailItem
mailitem, Outlook.Attachment attachment)
{
bool retval = false;
string CID = "";

try
{
if (attachment.FileName != "")
{
// this skips the olOLE types

MAPI.Session session = new Session();
session.Logon("", "", false, false, Type.Missing,
Type.Missing, Type.Missing);
MAPI.Message message =
(MAPI.Message)session.GetMessage(mailitem.EntryID, "");
MAPI.Attachments atts =
(Attachments)message.Attachments;


for (int teller = 0; teller
mailitem.Attachments.Count; teller++)
{
MAPI.Attachment att =
(MAPI.Attachment)atts.get_Item(teller+1);


MAPI.Fields fields = (MAPI.Fields)att.Fields;
MAPI.Field field =
(MAPI.Field)fields.get_Item(MAPI.CdoPropTags.CdoPR _ATTACH_FILENAME,
null);

if ((string)field.Value ==
attachment.FileName)
{
field =
(MAPI.Field)fields.get_Item(0x3712001F, null);
CID = (string)field.Value;

field =
(MAPI.Field)fields.get_Item(0x37140003, null);


if (!CID.StartsWith(attachment.FileName)
&& (int)field.Value !=4)
retval = true;
}
}
session.Logoff();
}
}
catch
{

}

if (attachment.Type ==
Microsoft.Office.Interop.Outlook.OlAttachmentType. olByValue && CID ==
"")
retval = true;

return retval;
}


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk Repeating Structures Table Looping and Table Extract
http://www.eggheadcafe.com/tutorials...g-structu.aspx
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inline attachments thru Fox7 bnmohan via OfficeKB.com Outlook and VBA 3 September 7th 07 02:36 PM
How do I view attachments inline? Shadowydreamer Outlook - Installation 0 September 6th 07 06:40 AM
View Attachments INline Buford T. Justice Outlook - General Queries 3 March 19th 07 11:55 AM
View Attachments INline Buford T. Justice Add-ins for Outlook 2 March 19th 07 11:55 AM
Outlook putting Word attachments inline as garbage KenW Outlook - Installation 0 June 22nd 06 02:02 AM


All times are GMT +1. The time now is 08:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.