Automatic Data Dumping

I am trying to access Project Names and numbers stored in a Lotus Notes database from another program.  What I would like to do is set up an automated job that dumps down a spreadsheet with this information whenever I go into the database (preferably on exiting it).  Does anyone have any suggestions?  Thanks.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Could u please be specific

this script exports PROJECTNAMEFIELD and PROJECTNUMBERFIELD , all documents in current view to: c:\export.txt
the fields are seperated with ";"
you must modify the PROJECTNAMEFIELD and PROJECTNUMBERFIELD to the names of the fields in your form.

include the script in the INITIALIZE EVENT of your VIEW, or make an ACTION BUTTON for the view, which i personally would do, so that you can controll when this happen. so not all of the users of the database suddenly get an c:\export.txt

Sub txtfileexport
     Dim db As notesdatabase
     Dim s As New notessession
     Dim Session As New notessession
     Dim doc As notesdocument
     Dim utv As notesdocumentcollection
     Dim filenum As Integer
     Dim fileName As String, oppslag As String, fileNameH As String
     Dim fileext As String
     Dim filepath As String
     Dim program As String
     Dim  platform As String
     Dim commandSet As String
     Dim n As Integer
     Dim c As Integer
     Dim lrc As Long
     Dim answer As Integer
     Dim PROJECTNAMEFIELD as string
          fileNum% = Freefile()
          fileName$ = "c:\export.txt"
          On Error Resume Next
          Kill fileName$
          Set db = s.CurrentDatabase
          Set utv = db.UnprocessedDocuments
          Set doc = utv.GetFirstDocument
          c = utv.count

'******* writes header-record to datafile **********    
          Open fileName$ For Append As fileNum%
          Print #fileNum%, "Projeckt name" & ";"  & "Project number"
          Close fileNum%    
          i = 0
          While Not doc Is Nothing                  
'          Print  linje$,  kunde
               Open fileName$ For Append As fileNum%
               Print #fileNum%, PROJECTNAME & ";"  & PROJECTNUMBER
               Close fileNum%          
               Set doc = utv.GetNextDocument(doc)
               i = i+1

End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kaldrichAuthor Commented:
Looks good.  I may have to modify the formats of the fields a bit, but I can work it from here.  Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.