INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Extract data from names.nsf through VB to .txt file

Extract data from names.nsf through VB to .txt file

(OP)
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?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close