attachment - 需要处理 $FILE 附件而我无法访问它们

标签 attachment lotusscript richtext

我有一封收到的电子邮件(mail-in db),其中包含一个 RichTextField,其中可以找到“一些”附件。我还发现附件不在 RTF 中,而是在文档中作为 $FILE。我正在尝试处理所有对象以将它们复制到另一封外发电子邮件。我可以使用下面的代码找到 $FILE。

 Dim rtiObject as NotesEmbeddedObject
 Dim rti_Email as NotesRichTextItem
 Dim obj_Email as NotesEmbeddedObject
 ForAll p in mailDoc.items
   if p.Name = "$FILE" then
     set obj_Email = mailDoc.GetAttachment(p.Values(0)) 'this will return the Name of the attachment (or file)
     set rtiObject = rti_Email.EmbedObject( EMBED_ATTACHMENT, "", obj_Email.Name) 'this is supposed to attach the file to the document's RTF
   End If
 End ForAll

当这个脚本运行时,它会找到 $FILE 文件并返回名称而不是对象,我无法从那里对它做任何事情。

我需要做什么才能从原始文档中获取附件/对象 ($FILE) 并将其附加到外发电子邮件中的 RTF?

我想过将附件分离到网络,然后将其附加到传出的电子邮件,然后从网络中删除附件,但这似乎不切实际。

有没有更好的方法来处理传入电子邮件中的这些 $FILE 类型的附件,从而使这更容易?

最佳答案

试试 EmbeddedObjects NotesDocument 的属性(property)目的。像这样的东西:

Forall obj_Email in MailDoc.EmbeddedObjects
  If obj_Email.Type = EMBED_ATTACHMENT then
    Call obj_Email.Extract(sometempdirectory$ & obj_Email.Name)
    Call rti_Email.EmbedObject(EMBED_ATTACHMENT, "", sometempdirectory$ & obj_Email.Name)
End Forall

您也可以这样做 without detaching如果你希望。

关于attachment - 需要处理 $FILE 附件而我无法访问它们,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10603374/

相关文章:

ruby-on-rails - Rails Paperclip 未定义方法 `validates_attachment'?

ruby-on-rails - 扩展 ActiveStorage::Attachment - 添加自定义字段

javascript - 如何在 Lotus 脚本上使用正则表达式?

java - IBM Notes 字段限制,是否可以选择将数据存储为富文本格式?

iphone - 如何为 iPhone 实现富文档编辑器

javascript - 我可以在富文本编辑器(打开设计模式的 iframe)中执行自定义命令吗?

c# - 如何设置 System.Net.Mail.MailMessage 的附件文件编码?

vba - 列出附件的文件名

lotus-notes - LotusScript 代理运行时错误 53 "File Not Found"(已解决)

xpages - 从数据库读取 "Template version is"