0

我想在.net 中访问lotu notes 的分类视图的内容。有人可以帮我解决这个问题吗?我正在使用interop.domino.dll。

Dim s As New Domino.NotesSession
Dim txt As String
Dim key() As String = {"abcd", "abcd"}
s.Initialize("")
Dim ldb As New NotesDatabase
ldb = s.GetDatabase("", "", False)
Dim vw As NotesView
vw = ldb.GetView("Project Module Wise Configurable Item")
vw.Refresh()
Dim entry As NotesViewEntry
Dim vc As NotesViewEntryCollection

vc = vw.GetAllEntriesByKey(key, False)
entry = vc.GetFirstEntry
While Not (entry Is Nothing)
     txt = CStr(entry.Item)
     entry = vc.GetNextEntry(entry)
     ListBox1.Items.Add(txt)
End While
4

2 回答 2

0

尝试:

    Dim s As New Domino.NotesSession
    s.Initialize("")

    Dim ldb As New NotesDatabase
    ldb = s.GetDatabase("", "", False)

    Dim vw As NotesView
    vw = ldb.GetView("Project Module Wise Configurable Item")
    vw.Refresh()

    Dim txt As String

    Dim entry As NotesViewEntry
    Dim vc As NotesViewEntryCollection

    'declare the array
' ---- edited -----
    Dim key(1) As variant
'----edited --- 
    key(0) = "abcd"
    key(1) = "abcd"

    'be carefull with the second parameter 'false'
    vc = vw.GetAllEntriesByKey(key, False)
    entry = vc.GetFirstEntry
    While Not (entry Is Nothing)
         txt = CStr(entry.Item)
         entry = vc.GetNextEntry(entry)
         ListBox1.Items.Add(txt)
    End While
于 2011-12-13T10:28:28.503 回答
0

什么对我有用:将键声明为对象数组。

Dim keys(0 To 1) As Object
keys(0) = "asdf"
keys(1) = "sgdk"
...
于 2016-01-19T11:32:30.473 回答