保存“设备无关位图"附件

编程入门 行业动态 更新时间:2024-10-26 00:23:39
本文介绍了保存“设备无关位图"附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何正确保存这种附件(来自签名邮件)?我用 .SaveAsFile 方法保存了它,但它没有任何扩展名,也没有应用程序可以打开它.

How to properly save this kind of attachment (from signed message)? I saved this with .SaveAsFile method, but it is without any extension and no application can open it.

Set OutItem = Application.ActiveExplorer.Selection.Item(1) For Each att In OutItem.Attachments att.SaveAsFile "C:\Temp\" & att.DisplayName Next

推荐答案

对于 olOlE 附件,您需要将附件作为 IStorage COM 对象打开并从其中的一个流中提取数据(可以被破坏)存储 - 您可以在 OutlookSpy 中查看数据:选择邮件,单击 OutlookSpy 功能区上的 IMessage 按钮,转到 GetAttachmentTable 选项卡,双击其中一个附件.选择 PR)_ATTACH_DATA_OBJ 属性,右击,IMAPIProp::OpenProperty,选择 IID_IStorage.无法使用 Outlook 对象模型在 VBA 中访问数据

For the olOlE attachments, you would need to open the attachment as an IStorage COM object and extract the data (which can be mangled) from one of the streams inside the storage - you can see the data in OutlookSpy: select the message, click IMessage button on the OutlookSpy ribbon, go to the GetAttachmentTable tab, double click on one of the attachments. Select the PR)_ATTACH_DATA_OBJ property, right click, IMAPIProp::OpenProperty, select IID_IStorage. The data cannot be accessed in VBA using the Outlook Object Model

如果使用 Redemption 是一种选择,则其 RDOAttachment.SaveAsFile 方法足够智能,可以从存储中提取 BMP、EMF、PDF、Excel 等文件数据.类似于以下内容(在我的脑海中)应该可以完成这项工作:

If using Redemption is an option, its RDOAttachment.SaveAsFile method is smart enough to extract BMP, EMF, PDF, Excel, etc. file data from the storage. Something like the following (off the top of my head) should do the job:

set Session = CreateObject("Redemption.RDOSession") Session.MAPIOBJECT = Application.Session.MAPIOBJECT set rMsg = Session.GetRDOObjectFromOutlookObject(Application.ActiveExplorer.Selection.Item(1)) For Each att In rMsg.Attachments att.SaveAsFile "C:\Temp\" & att.FileName Next

更多推荐

保存“设备无关位图"附件

本文发布于:2023-11-06 07:53:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563120.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:位图   附件   设备   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!