These days, outlook emails are composed in three formats; plain text, html and rtf (rich text format). If an email is in rtf and it has attachments, as well as, embedded image or signature, it poses a problem in outlook automation. When you are reading attachments in an outlook automation program, your program will recognize the embedded image/signature as an attachment. Although, it is not an attachment from the sender. So, you need to apply some sort of filtering in your loop. Here it is……

using System;
using System.Collections.Generic;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.IO; Outlook.MailItem item = null;
Outlook.PropertyAccessor prop; // intialize item to a mail item
foreach (Outlook.Attachment atmt in item.Attachments)
{
prop = atmt.PropertyAccessor; string contentID = (string)prop.GetProperty(“http://schemas.microsoft.com/mapi/proptag/0x3712001E“); if (contentID != “”)
continue; else //do something ; } If the ContentID is not found, it is not an actual attachment, rather an embedded image/signature.

最新文章

  1. Moon.Orm 5.0 (MQL版) 实战实例
  2. Asp.net(C#) windows 服务{用于实现计划任务,事件监控等}
  3. Hadoop:pig 安装及入门示例
  4. API接口验证
  5. QPaintDevice: Cannot destroy paint device that is being painted
  6. Java中的比较
  7. Java学习日记-2.3 基本数据类型和对象所占内存空间大小
  8. 手把手教你如何加入到github的开源世界! (转)
  9. 初步学习nodejs,业余用node写个一个自动创建目录和文件的小脚本,希望对需要的人有所帮助
  10. WisKey的眼神
  11. iOS开发 调用系统相机和相册
  12. String类理解
  13. 软件安装之-------VM虚拟机安装windows系统
  14. ArcGIS Server10.2 集群部署注意事项
  15. LeetCode(117):填充同一层的兄弟节点 II
  16. PostgreSQL数组使用
  17. [Hinton] Neural Networks for Machine Learning - Basic
  18. awk中截取IP字段
  19. 前端阶段_html部分
  20. 踩过无数坑实现的哈夫曼压缩(JAVA)

热门文章

  1. pythonのdjango
  2. Pycharm工具导入requests包(python新手)
  3. Codeforces 877E - Danil and a Part-time Job 线段树+dfs序
  4. TCP 的那些事儿
  5. JAVA 数组元素的反转
  6. 【深度学习】吴恩达网易公开课练习(class2 week1)
  7. IP地址分类(A类 B类 C类 D类 E类)
  8. Vue 增删改查 demo
  9. vs 2012 更新update4 后出现问题
  10. SQL反模式学习笔记6 支持可变属性【实体-属性-值】