stevenvanaken
Programmer
I have Visual Basic 2010 express and Lotus Notes 8.5.
I would like to extract (to txt) the entries from the names.nsf. The output is nothing, although I use the proper VB script:
Dim ses As New Domino.NotesSession, str_DbName As String, str_nsf As String
Dim db As Domino.NotesDatabase, dc As NotesView, doc As Domino.NotesDocument
str_DbName = <database name>
str_nsf = <database file location>
Call ses.Initialize()
db = ses.GetDatabase(str_DbName, str_nsf, False)
If db.IsOpen Then
Dim str_User_ID
Dim FileSyst As Object = CreateObject("Scripting.FileSystemObject")
Dim ExportFile As Object = FileSyst.CreateTextFile("c:\temp\Address_Book.txt", True)
Dim str_User_ID
dc = db.GetView("People")
doc = dc.GetFirstDocument
While Not (doc Is Nothing)
str_User_ID = doc.GetItemValue("ShortName")
ExportFile.WriteLine(str_User_ID(0) & Chr(9))
doc = dc.GetNextDocument(doc)
End While
ExportFile.Close()
Else
Rem Does not exist
End If
Exit Sub
I assume I'm not using the right view, however this is what I see in the names.nsf. Can somebody assist me in resolving this, please?
I would like to extract (to txt) the entries from the names.nsf. The output is nothing, although I use the proper VB script:
Dim ses As New Domino.NotesSession, str_DbName As String, str_nsf As String
Dim db As Domino.NotesDatabase, dc As NotesView, doc As Domino.NotesDocument
str_DbName = <database name>
str_nsf = <database file location>
Call ses.Initialize()
db = ses.GetDatabase(str_DbName, str_nsf, False)
If db.IsOpen Then
Dim str_User_ID
Dim FileSyst As Object = CreateObject("Scripting.FileSystemObject")
Dim ExportFile As Object = FileSyst.CreateTextFile("c:\temp\Address_Book.txt", True)
Dim str_User_ID
dc = db.GetView("People")
doc = dc.GetFirstDocument
While Not (doc Is Nothing)
str_User_ID = doc.GetItemValue("ShortName")
ExportFile.WriteLine(str_User_ID(0) & Chr(9))
doc = dc.GetNextDocument(doc)
End While
ExportFile.Close()
Else
Rem Does not exist
End If
Exit Sub
I assume I'm not using the right view, however this is what I see in the names.nsf. Can somebody assist me in resolving this, please?