Manage Learn to apply best practices and optimize your operations.

Document list of your Domino.doc library

How to put a list of all documents of a chosen cabinet in the Domino.doc library into an MS Excel workbook.

This agent works for selected documents in the "main view" in the Dom.doc library database. It puts a list of all documents of chosen cabinets (chosen by selecting documents from the view) into a MS Excel workbook. It puts each list of a cabinet into a different worksheet and gives the cabinet's name to a workbook.

Sub Initialize
 Dim s As New NotesSession
 Dim dblib As NotesDatabase
 Dim vlib As NotesView 
 Dim doclib As notesdocument  
 Dim Dbbinder As NotesDatabase
 Dim vbinder As NotesView
 Dim docbinder As notesdocument 
 Dim db As NotesDatabase
 Dim v As NotesView
 Dim doc As notesdocument 
 Dim tarih As notesdatetime
 Dim excelapp As Variant
 ' My MS Excel is XP, therefore this 
parameter is 10
 Set excelapp=createobject
("Excel.Application.10")
 excelapp.Visible = True
 Dim excelwb As Variant
 Dim excelws As Variant
 Set excelwb=excelapp.workbooks.add()  
 
 Set dblib =s.currentdatabase
 Dim collection As 
NotesDocumentCollection
 Set collection = dblib.
UnprocessedDocuments
 Set doclib = collection.
GetFirstDocument()
 
 Do
  Set dbbinder=s.getdatabase
(dblib.server,doclib.dbname(0))
  Set vbinder=dbbinder.getview
("(ServerProfileList)")
  Set docbinder=vbinder.getfirstdocument
  
  Set excelws=excelwb.worksheets.Add()
  excelws.Name=Left(dbbinder.Title,31)
  Excelws.range("A1").value="Binder"
  Excelws.range("B1").value="Doc Name"
  Excelws.range("C1").value="Version"
  Excelws.range("D1").value=
"Last Modified Date"
  i=2
  dbname=docbinder.currDocDBPath(0)
  Set db =s.getdatabase
(dblib.Server,dbname)
  Set v=db.GetView("(DocsByBinderID)")
  Set doc=v.getfirstdocument
  While Not(doc Is Nothing)
   Excelws.range("A" & Cstr(i)).
value=doc.Doctype(0)
   Excelws.range("B" & Cstr(i)).
value=doc.title(0)
   If doc.format(0)="Link" Then
    vers=""
   Else
    vers=Cstr(doc.version(0)) & "." 
& Cstr(doc.draft(0))
   End If
   Excelws.range("C" & Cstr(i)).
value=vers
   Set tarih = New NotesDateTime
( doc.LastModDate(0) )
   Excelws.range("D" & Cstr(i)).
value=tarih.dateonly
   i=i+1
   Set doc=v.getnextdocument(doc)
  Wend
  Call Excelws.range("A1:D" & 
Cstr(i-1)).Autoformat(True)
  Set doclib = collection.
GetNextDocument(doclib)
 Loop Until doclib Is Nothing
End Sub

Do you have comments on this tip? Let us know.

Dig Deeper on Lotus Notes Domino Agents

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close