【发布时间】:2022-12-18 06:44:38
【问题描述】:
我希望在一些文件到达我的邮寄申请时对其进行修改。 (我需要删除 $REF 字段,然后允许拖放到文件夹中,但这不是重点。)
我将代理设置为“新邮件到达后”并选择未处理的文档。未处理文档的设计器帮助状态...
代理属性为....
但是代理会选择收件箱中已修改或编辑的任何文档,而不仅仅是新到达的电子邮件。在代理运行之前,还有最多一分钟的延迟。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
If doc.Hasitem("$REF") Then
doc.Subject= "($Ref) " & doc.Subject(0) 'Only testing here will remove item if exists
Else
doc.Subject = "(No Ref) " & doc.Subject(0)
End If
Call doc.save(True,False)
' Call session.UpdateProcessedDoc( doc ) 'This doesn't appear to make any difference.
Set doc = collection.GetNextDocument(doc)
Wend
End Sub
任何帮助仅在新邮件上运行此类脚本并且比现在更快的帮助,因为用户可以在代理运行之前编辑文档,将不胜感激。 谢谢
【问题讨论】: