MikeSanders
Programmer
Hello,
I have successfully created a Visual Basic application which allows the end user to use Lotus Notes to send an e-mail using a late-bound COM interface. However, I have an issue related to the time it takes to retrieve a list of 1,000+ Notes e-mail addresses using the NotesView class GetFirstDocument and GetNextDocument methods. It can take more than 10 seconds to retrieve a list of 1000 e-mail addresses via the NotesView class methods. Is there an alternative method which would be faster?
Here is a VB code snippet to help describe my situation:
Dim oSess As Object
Dim oView As Object
Dim oDoc As Object
Dim v As Variant
Dim var As Variant
Dim lAddr As Long
Dim lAddrCount As Long
Dim sAddress() As String
Dim vTmps() As Variant
var = oSess.ADDRESSBOOKS
'open each address book
For Each v In var
v.Open "", ""
'if address book is "PUBLIC" then
If v.Title Like "*PUBLIC*" Then
'get all documents within the "People" view
'note: each document within the "People" view contains a valid e-mail address
Set oView = v.GETVIEW("People"
'determine # of people and initialize array
lAddrCount = oView.TopLevelEntryCount
ReDim sAddress(lAddrCount)
'find first person
Set oDoc = oView.GETFIRSTDOCUMENT
Do While Not oDoc Is Nothing
vTmps = oDoc.COLUMNVALUES
'add person's name to array
lAddr = lAddr + 1
sAddress(lAddr) = vTmps(0)
Set oDoc = oView.GETNEXTDOCUMENT(oDoc)
Loop
Exit For
End If
Next
Thank you,
Mike Sanders
I have successfully created a Visual Basic application which allows the end user to use Lotus Notes to send an e-mail using a late-bound COM interface. However, I have an issue related to the time it takes to retrieve a list of 1,000+ Notes e-mail addresses using the NotesView class GetFirstDocument and GetNextDocument methods. It can take more than 10 seconds to retrieve a list of 1000 e-mail addresses via the NotesView class methods. Is there an alternative method which would be faster?
Here is a VB code snippet to help describe my situation:
Dim oSess As Object
Dim oView As Object
Dim oDoc As Object
Dim v As Variant
Dim var As Variant
Dim lAddr As Long
Dim lAddrCount As Long
Dim sAddress() As String
Dim vTmps() As Variant
var = oSess.ADDRESSBOOKS
'open each address book
For Each v In var
v.Open "", ""
'if address book is "PUBLIC" then
If v.Title Like "*PUBLIC*" Then
'get all documents within the "People" view
'note: each document within the "People" view contains a valid e-mail address
Set oView = v.GETVIEW("People"
'determine # of people and initialize array
lAddrCount = oView.TopLevelEntryCount
ReDim sAddress(lAddrCount)
'find first person
Set oDoc = oView.GETFIRSTDOCUMENT
Do While Not oDoc Is Nothing
vTmps = oDoc.COLUMNVALUES
'add person's name to array
lAddr = lAddr + 1
sAddress(lAddr) = vTmps(0)
Set oDoc = oView.GETNEXTDOCUMENT(oDoc)
Loop
Exit For
End If
Next
Thank you,
Mike Sanders