我需要编写代码以查找同一内部域中近期联系人视图中的重复项。我不打算接触外部互联网联系人。是否有任何特殊的属性或方法来做到这一点(在莲花脚本?)比较所有视图条目与服务器NAB是好主意?任何人都可以建议我这样做的最佳方式?在最近的联系人视图中查找重复的联系人
0
A
回答
1
不知道如果我完全得到你所需要的,但这里是我建议
我建议写的小一串代码,通过视图(最近联系人)行走,并创建一个列表,并把那里只有唯一对/ key和doc存储在另一个地方都是重复的。
,您可以创建这样的代码的代理(请注意,我可能会用错了钥匙,所以只定义哪个领域你是一个独特的密钥),即
Dim session As New NotesSession
Dim view As NotesView
Dim doc As NotesDocument
Dim uniquedocs List As Variant
Dim duplicates As string
Dim key As String
Set view = session.Currentdatabase.Getview("(Recent Contacts)")
Set doc = view.Getfirstdocument()
While Not doc Is Nothing
' this is the unique key, please change it if you need
key = doc.Getitemvalue("MailDomain")(0)
If key <> "" Then
If Not IsElement(uniquedocs(key)) Then
Set uniquedocs(key) = doc
Else
If duplicates <> "" Then duplicates = duplicates & " | "
duplicates = duplicates & key
End If
End If
Set doc = view.Getnextdocument(doc)
Wend
MsgBox duplicates
重复 - 与所有邮件串 MSGBOX错误()& “” & Erl的() 退出子 结束SU:具有鉴于至少2个触点(最近的联系人)
0
Sub Initialize
On Error GoTo errHandler
Dim session As New NotesSession
Dim db As NotesDatabase
Dim currdb As NotesDatabase
Dim view As NotesView
Dim view1 As NotesView
Dim vc As NotesViewEntryCollection
Dim namesentry As NotesViewEntry
Dim serdoc As NotesDocument
Dim localdoc As NotesDocument
Dim item As NotesItem
Dim dname As String
Dim serverfullName() As String
Dim localfulName As String
Dim formula As String
Dim result As Variant
Dim count As Integer
'Getting all the documents from servers NAB ,put that in document collection
Set db=session.GetDatabase("Myserver","names.nsf")
Set view=db.GetView("People")
Set vc = view.AllEntries
Set namesentry = vc.Getfirstentry()
ReDim Serverfullname(CInt(vc.Count))
count = 0
'storing fullnames in array
While Not namesentry Is Nothing
Set serdoc = namesentry.Document
serverfullName(count) = serdoc.Getitemvalue("FullName")(0)
Set namesentry = vc.Getnextentry(namesentry)
count = count + 1
Wend
'keeping the string format for Comparison
Dim x As String
Dim iteration As Integer
x = ""
iteration = 0
ForAll i In Serverfullname
iteration = iteration + 1
If i ="" Then
ElseIf count = iteration Then
x = x + |"| + i + |"|
Else
x = x + |"| + i + |"| + ":"
End If
End ForAll
'MsgBox x 'Displaying servers fullname list
'Geetting local NAB contacts
Set currdb= session.CurrentDatabase
Dim selFormula As String
'creating New view to filter documents with same domain
selFormula= {SELECT @UpperCase($AutoCreatedList) = "DIP" & @LowerCase(MailDomain)[email protected]("mydomain")}
Call currdb.Createview("RecentView",selFormula)
Set view1 = currdb.GetView("RecentView")
Set localdoc = view1.GetFirstDocument
While Not localdoc Is Nothing
localfulName = localdoc.Getitemvalue("FullName")(0)
Dim indexresult As Variant
Dim Formula1 As String
Formula1 = |@Contains(| & x & |;"| + Localfulname + |")|
'MsgBox Formula1
indexresult = Evaluate(Formula1)
If indexresult(0)= 0 Then
MsgBox " Duplicate entry " & localfulname & "."
'Call localdoc.Remove(true)
End If
Set localdoc = view1.Getnextdocument(localdoc)
Wend
Exit sub
errHandler域b
相关问题
- 1. 出现在联系人中的联系人编辑视图UI
- 2. PHP-EWS - 查找联系人子文件夹中的联系人
- 3. Android设备联系人显示重复的联系人条目
- 4. 如何在列表中查找重复的联系人查看
- 5. 访问最近的联系人iOS 9
- 6. 从呼叫日志获取DISTINCT最近联系的联系人
- 7. C#查找Outlook联系人
- 8. 检索联系人时出现重复联系人问题
- 9. 联系人视图iphone SDK
- 10. 如何删除在列表视图中重复的联系人?
- 11. 当联系人被人使用时联系人的图标
- 12. 复制我的联系人列表的WhatsApp联系人
- 13. 寻找在联系人应用程序中绕过联系人的图像
- 14. 在桌面视图中显示联系人图像以及联系人姓名
- 15. 检索所有联系人时跳过最联系的联系人
- 16. 试图在Android联系人中存储联系人条目
- 17. iPhone - 查看像SMS联系人视图
- 18. 如何在插入新联系人时检测到重复的联系人?
- 19. 寻找有联系的人
- 20. 微分Outlook联系人(联系人)
- 21. 谷歌联系人:唯一联系人?
- 22. 常量联系人 - 更新联系人
- 23. 如何在找到联系人后选择联系人? Ionic 2
- 24. 联系人中的SIM卡联系人收件人数据.CONTENT_URI
- 25. 偏好项目的重复联系人
- 26. 如何在联系人上查询联系人Android
- 27. 在Joomla联系人组件中捕获的联系人线索
- 28. 联系人提供商的联系人源图标
- 29. 添加的联系人不在联系人显示在Android的
- 30. 查找联系人的电话号码
让我很明确的告诉我的要求, 我需要从本地names.nsf中的所有条目,然后我需要每个文档(联系人)与服务器NAB比较,如果不存在我需要删除联系人或从本地names.nsf – Mythli
文件我试过代码如下, 首先,我会从服务器NAB的“人”观统领全名称值,并将其存储在字符串数组。 这是做这件事的最好方法吗? 然后我会得到所有条目从本地NAB, 然后内部循环,我将全名各个接点(在最近联系人视图)与全名 的服务器阵列,如果它返回false,这是重复的,所以我会从删除比较当地人。 – Mythli
是的,你写的是正确的方式,我会做同样的,你写的。 –