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.

Differenciate or distinguish between outlook attachment and embedded image/signature using property accessor in C#.NET的更多相关文章

  1. [VSTO] 区分MAILITEM的ATTACHMENT是真正的附件还是内嵌资源

    在遍历MailItem的Attachments集合的时候发现,不管是真正的附件还是内嵌资源,比如邮件内容中内嵌的图片(Embedded Image),都是Attachments集合的元素,通过查看at ...

  2. [转]Extending the User Interface in Outlook 2010

    本文转自:https://msdn.microsoft.com/en-us/library/office/ee692172%28v=office.14%29.aspx#OfficeOLExtendin ...

  3. [转]C#操作Outlook

    本文转自:https://blog.csdn.net/yanlovehan/article/details/8500449 //引用Microsoft.Office.Interop.Outlook.d ...

  4. [转]Creating a custom ribbon for Outlook 2013, 2010 and toolbar for Outlook 2007, 2003 – C# sample

    本文转自:https://www.add-in-express.com/creating-addins-blog/2013/05/21/outlook-ui-customization-ribbons ...

  5. C#.NET开源项目、机器学习、商务智能

    所以原谅我,不能把所有的都发上来,太杂了,反而不好. 1..NET时间周期处理组件 这个组件很小,主要是对时间日期,特别是处理时间间隔以及时间范围非常方便.虽然.NET自带了时间日期的部分功能,但可能 ...

  6. nutch-default.xml文件

    Nutch中的所有配置文件都放置在总目录下的conf子文件夹中,最基本的配置文件是conf/nutch-default.xml.这个文件中定义了 Nutch的所有必要设置以及一些默认值,它是不可以被修 ...

  7. iOS开发——高级技术&签名机制

    签名机制 最近看了objc.io上第17期中的文章 <Inside Code Signing> 对应的中文翻译版 <代码签名探析> ,受益颇深,对iOS代码签名机制有了进一步的 ...

  8. emWin使用外部SRAM的方法

    我用的是stm32,加了1MB的外部SRAM,在使用emWin的时候,将一部分内存分配给emWin使用.其实方法很简单,传入SRAM数据总线地址即可,数据位宽我采用16bit,因为使用的SRAM是16 ...

  9. Android 应用接入广点通统计API 方案

    官方给你参考文档,很扯淡,是c++和python脚本: 安卓java代码接入如下: package com.edaixi.util; import java.io.UnsupportedEncodin ...

随机推荐

  1. Concurrent下的线程安全集合

    1.ArrayBlockingQueue ArrayBlockingQueue是由数组支持的线程安全的有界阻塞队列,此队列按 FIFO(先进先出)原则对元素进行排序.这是一个典型的“有界缓存区”,固定 ...

  2. LOJ 3049: 洛谷 P5284: 「十二省联考 2019」字符串问题

    题目传送门:LOJ #3049. 题意简述: 给定一个长度为 \(n\) 的母串 \(S\). 有 \(n_a\) 个 A 类串,都是 \(S\) 的子串,以区间的形式给出. 有 \(n_b\) 个 ...

  3. 【原创】大叔问题定位分享(23)Ambari安装向导点击下一步卡住

    ambari安装第一步是输入集群name,点击next时页面卡住不动,如下图: 注意到其中一个接口请求结果异常,http://ambari.server:8080/api/v1/version_def ...

  4. cocos2dx-lua 文件操作

    print("开始") --检查文件是否存在 local path = "ABC.txt" local fileExist = cc.FileUtils:get ...

  5. 利用特性和反射给泛型Model赋值

    为了解决从数据库读取的表字段和自己建的viewModel字段名称不相符的问题 本人小白,初次将特性及反射应用到实例,写的不好的地方还请大家多多包涵 新建一个控制台应用程序命名为ReflectAndAt ...

  6. jquery 第三章

    1.回顾$(document).ready(function(){    })$(function(){    }) ID选择器.类选择器.元素选择器层次选择器:空格(上文下:tr td{})属性过滤 ...

  7. thinkPHP中M()和D()的区别

    在实例化的过程中,经常使用D方法和M方法,这两个方法的区别在于M方法实例化模型无需用户为每个数据表定义模型类,如果D方法没有找到定义的模型类,则会自动调用M方法.通俗一点说:M实例化参数是数据库的表名 ...

  8. Eclipse连接HBase 报错:org.apache.hadoop.hbase.PleaseHoldException: Master is initializing

    在eclipse中连接到HBase报错org.apache.hadoop.hbase.PleaseHoldException: Master is initializing,搜索了好久,网上其它人说的 ...

  9. echarts的地图点击事件

    1.echarts的地图展示,有时候展示出的数据,虽然鼠标点击上去某个省份或者某个地方会有数据显示,但是点击一下地图没有任何动态效果,如何添加地图点击效果呢,这里自己也是坐下笔记,方便以后使用. 参考 ...

  10. Kafka(二)CentOS7.5搭建Kafka2.11-1.1.0集群与简单测试

    一.下载 下载地址: http://kafka.apache.org/downloads.html    我这里下载的是Scala 2.11对应的 kafka_2.11-1.1.0.tgz 二.kaf ...