如何在 Outlook 2010 中向 HTML 邮件添加嵌入图像 [英] How to add an embedded image to an HTML message in Outlook 2010

查看:30
本文介绍了如何在 Outlook 2010 中向 HTML 邮件添加嵌入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用 此处描述的技术嵌入的 Office 2003 VBA 代码使用未记录的 MAPI 属性和 CDO 1.21 的 HTML 消息中的图像.

I have Office 2003 VBA code that uses the technique described here to embed an image in an HTML message using undocumented MAPI properties and CDO 1.21.

不再支持 CDO 1.21,但 根据 MSDN,它的大部分功能现在都已合并到 Outlook 2010 对象模型中.

CDO 1.21 is no longer supported, but according to MSDN, most of its functionality is now incorporated into the Outlook 2010 object model.

在哪里可以找到使用 Outlook 2010 对象模型在 Outlook 2010 邮件中嵌入图像的示例?

Where can I find a sample that embeds images in an Outlook 2010 message using the Outlook 2010 object model?

推荐答案

找到答案 这里.

关键位是:

Const PR_ATTACH_MIME_TAG = "http://schemas.microsoft.com/mapi/proptag/0x370E001E"        
Const PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001E"        
Const PR_ATTACHMENT_HIDDEN = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B" 

...

Set colAttach = l_Msg.Attachments        
For x = 1 To Items.Count            
    Set l_Attach = colAttach.Add(Items.Item(x))            
    Set oPA = l_Attach.PropertyAccessor            
    oPA.SetProperty PR_ATTACH_MIME_TAG, ItemTypes.Item(x)            
    oPA.SetProperty PR_ATTACH_CONTENT_ID, "item" & x            
    oPA.SetProperty PR_ATTACHMENT_HIDDEN, True        
Next

这篇关于如何在 Outlook 2010 中向 HTML 邮件添加嵌入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆