how can i handle the attachment of an attachment?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 22:20:12

问题


I am automatically processing emails in a certain inbox. However our suppliers should send emails to that inbox with one pdf-attachment. and this pdf-attachment should be saved to a certain folder - no problem so far.

But: one supplier is sending emails that only contain another email as attachment and only in that "sub-email" the pdf is to be found. For some reasons he is not able to change that.

Now it does not seem possible to use that attachment of the attachment as mailitem:

Set objMail_New = objMail_In.Attachments.Item(1)

neither could i forward the attachment to the same mail-address again (which would have brought me the mail that I needed in the first place):

Set objMail_Forw = objMail_In.Attachments.Item(1).forward

Both bring the error "type mismatch"

Anyone any other ideas? Maybe it is possible to save the (first) attachment locally and then handle it to get to the second attachment?

Thanks max


回答1:


Outlook does not allow to access embedded message attachments. The best you can do is save the attachment as an MSG file (Attachment.SaveAsFile), then open it using Namespace.OpenSharedItem.

You can also use Redemption which allows to access embedded messages attachment using RDOAttachment.EmbeddedMsg



来源:https://stackoverflow.com/questions/18723017/how-can-i-handle-the-attachment-of-an-attachment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!