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 ...
随机推荐
- 【JS】长轮询
循环请求服务器数据 function send () { xhr.open('GET', '/clock', true); xhr.onreadystatechange = function () { ...
- 简易解说拉格朗日对偶(Lagrange duality)
引言:尝试用最简单易懂的描述解释清楚机器学习中会用到的拉格朗日对偶性知识,非科班出身,如有数学专业博友,望多提意见! 1.原始问题 假设是定义在上的连续可微函数(为什么要求连续可微呢,后面再说,这里不 ...
- P5290 [十二省联考2019]春节十二响
题目地址:P5290 [十二省联考2019]春节十二响 骗分方法 如果你实在一点思路也没有,暴力都不会打,那么请考虑一下骗分. 方法一 输出所有 \(M\) 的和. 期望得分:0分. 实际还有5分 方 ...
- 主机服务绑定IP
在用 netstat -na 查看当前主机提供的服务,例如显示如下结果: tcp 0 0 127.0.0.1:9000 0.0.0.0:* ...
- c#基础之Type
官方文档:https://msdn.microsoft.com/zh-cn/library/system.type%28v=vs.110%29.aspx?f=255&MSPPError=-21 ...
- Lua中的语句
[赋值] 赋值的基本含义是修改一个变量或一个table中字段的值,这个和其它语言没有多少区别,但是对于Lua,有一个特性,它允许“多重赋值”,也就是一下子将多个值赋予多个变量,例如以下代码: , pr ...
- ILMerge在MSBuild与ILMerge在批处理文件中运行
ILMerge ILMerge是一个将多个.NET程序集合并到一个程序集中的实用程序.它可以免费使用,并以NuGet包的形式提供. 如果您在使用它时遇到任何问题,请与我们联系.(mbarnett at ...
- Windows Internals 笔记——作业
1.Windows提供了一个作业内核对象,它允许我们将进程组合在一起并创建一个“沙箱”来限制进程能够做什么.创建只包含一个进程的作业同样非常有用,因为这样可以对进程施加平时不能施加的限制. 2.如果进 ...
- vs2017 winform打包
如果没有Visual Studio Installer 说明没有安装打包插件 安装打包插件:Microsoft Visual Studio 2017 Installer Projects 工具 --& ...
- [转] 扩展微信小程序框架功能
通过第三方 JavaScript 库,扩展微信小程序框架功能. 扩展微信小程序框架功能(1)——Promise ES6 对 Promise 有了原生的支持,但微信开发者工具更新版本(0.11.1122 ...