Differenciate or distinguish between outlook attachment and embedded image/signature using property accessor in C#.NET
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的更多相关文章
- [VSTO] 区分MAILITEM的ATTACHMENT是真正的附件还是内嵌资源
在遍历MailItem的Attachments集合的时候发现,不管是真正的附件还是内嵌资源,比如邮件内容中内嵌的图片(Embedded Image),都是Attachments集合的元素,通过查看at ...
- [转]Extending the User Interface in Outlook 2010
本文转自:https://msdn.microsoft.com/en-us/library/office/ee692172%28v=office.14%29.aspx#OfficeOLExtendin ...
- [转]C#操作Outlook
本文转自:https://blog.csdn.net/yanlovehan/article/details/8500449 //引用Microsoft.Office.Interop.Outlook.d ...
- [转]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 ...
- C#.NET开源项目、机器学习、商务智能
所以原谅我,不能把所有的都发上来,太杂了,反而不好. 1..NET时间周期处理组件 这个组件很小,主要是对时间日期,特别是处理时间间隔以及时间范围非常方便.虽然.NET自带了时间日期的部分功能,但可能 ...
- nutch-default.xml文件
Nutch中的所有配置文件都放置在总目录下的conf子文件夹中,最基本的配置文件是conf/nutch-default.xml.这个文件中定义了 Nutch的所有必要设置以及一些默认值,它是不可以被修 ...
- iOS开发——高级技术&签名机制
签名机制 最近看了objc.io上第17期中的文章 <Inside Code Signing> 对应的中文翻译版 <代码签名探析> ,受益颇深,对iOS代码签名机制有了进一步的 ...
- emWin使用外部SRAM的方法
我用的是stm32,加了1MB的外部SRAM,在使用emWin的时候,将一部分内存分配给emWin使用.其实方法很简单,传入SRAM数据总线地址即可,数据位宽我采用16bit,因为使用的SRAM是16 ...
- Android 应用接入广点通统计API 方案
官方给你参考文档,很扯淡,是c++和python脚本: 安卓java代码接入如下: package com.edaixi.util; import java.io.UnsupportedEncodin ...
随机推荐
- Chrome firefox ie等浏览器空格 宽度不一样
用半角空格 或者全角空格 相当于半格中文字符的宽度, 相当于一个中文字符宽度. 注:在chrome中两个 占一个汉字的宽度;,而在IE.firefox中四个 才占一个汉字的宽度.
- codeblocks添加编译选项
-std=c++0x
- Python学习笔记-Linux下安装Python
Linux系统CentOS 1.安装依赖组件 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel s ...
- 对OAuth协议的认识
一. OAuth是什么 OAuth 是Open Authorization的简写.OAuth 协议为用户资源的授权提供了一个安全的.开放而又简易的标准. 通俗地说,就是当我们想把自己系统的某些功能暴露 ...
- C语言malloc函数为一维,二维,三维数组分配空间
c语言允许建立内存动态分配区域,以存放一些临时用的数据,这些数据不必在程序的声明部分定义,也不必等到函数结束时才释放,而是需要时随时开辟,不需要时随时释放,这些数据存储在堆区.可以根据需要,向系统申请 ...
- 【easy】404. Sum of Left Leaves
求所有左节点的和. /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; ...
- SpringBoot入门基础
目录 SpringBoot入门 (一) HelloWorld. 2 一 什么是springboot 1 二 入门实例... 1 SpringBoot入门 (二) 属性文件读取... 16 一 自定义属 ...
- Confluence 使用常见问题列表
Confluence 6 管理 Atlassian 提供的 App 摘要: Confluence 用户可以使用桌面应用来编辑一个已经上传到 Confluence 的文件,然后这个文件自动保存回 Con ...
- Java_变量类型
目录 主要是为了复习java相关知识,本文主要内容来自于 http://www.runoob.com/java 一.局部变量 局部变量声明在方法.构造方法或语句块中 在方法.构造方法.语句块被执行的时 ...
- hadoop家族技能图谱