我有一封收到的电子邮件(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/