use*_*708 1 lotus-notes lotusscript
我有以下代码:
Forall agent In db.agents
'I need to remove "$MachineName" item from all agents
End Forall
Run Code Online (Sandbox Code Playgroud)
如何从NotesAgent中删除"$ MachineName"项?或者我如何将NotesAgent转换为NotesDocument以便我可以删除此项目?
您必须将代理作为设计元素.这可以通过NotesNoteCollection课程来实现:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim i As long
Dim nc As NotesNoteCollection
Dim noteid As string
Set db = session.CurrentDatabase
Set nc = db.CreateNoteCollection(False)
nc.SelectAgents = true
Call nc.BuildCollection
noteid = nc.Getfirstnoteid()
For i=1 To nc.Count
Set doc = db.Getdocumentbyid(noteid)
Call doc.Removeitem("$MachineName")
Call doc.Save(true, true)
noteid = nc.Getnextnoteid(noteid)
Next
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
134 次 |
| 最近记录: |