0

I want to access contents of a catagorized view of lotu notes in .net.... can some one help me regarding this.. I am using 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
Jasper Duizendstra
  • 2,587
  • 1
  • 21
  • 32
Deepak Saini
  • 41
  • 1
  • 4
  • 11

2 Answers2

0

What worked for me: Declaring key as array of object.

Dim keys(0 To 1) As Object
keys(0) = "asdf"
keys(1) = "sgdk"
...
0

try:

    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
Jasper Duizendstra
  • 2,587
  • 1
  • 21
  • 32
  • Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)) at the same line "vc = vw.GetAllEntriesByKey(key, False)" – Deepak Saini Dec 14 '11 at 11:39
  • From the help: "If this method is used under COM, with a keyArray parameter of an array, it must be defined as an array of type Variant." – Jasper Duizendstra Dec 15 '11 at 07:56