首页 > 解决方案 > ForAll 循环破坏 Lotus Notes 中电子邮件的内联图像

问题描述

我确实有一封包含内嵌图像的 Lotus Notes 电子邮件。当我运行以下仅更改电子邮件主题的代码行时,内联图像会丢失。

Sub Initialize

Dim ns As New NotesSession
Dim nc As NotesDocumentCollection
Dim nd As NotesDocument

Set nc = ns.Currentdatabase.Unprocesseddocuments()  
Set nd = nc.GetFirstDocument()

    ForAll Items In nd.Items

    End ForAll

Call nd.Replaceitemvalue("Subject", "Forall")
Call nd.Save(True, False)

End Sub

问题是由实际上没有做任何事情的 ForAll 循环引起的。如果循环被注释掉,内联图像仍保留在电子邮件中。

带有内嵌图像的原始电子邮件

forall 循环后的电子邮件

我希望你们中的任何人有一个想法或建议如何解决这个问题。

干杯,马丁

标签: emaillotus-noteslotus-dominoemail-attachmentslotusscript

解决方案


访问项目时,您的邮件正文可能正在从 Notes 富文本转换为 MIME,然后被重新保存,从而失去保真度。

尝试ns.ConvertMIME = false在代码的开头设置。


推荐阅读