|
|
|
BlueCielo Meridian Enterprise 2012 Developer's Guide | BlueCielo ECM Solutions |
Reading property values for multiple documents is best done using a tableview. The following code sample demonstrates the use of the IAMTableView object.
Dim PropertySet As AMPropertySet
Dim AllDocumentInFolder As IAMTableView
Dim AllProperties As Variant
Dim indexAuthor As Long
Dim Author As Variant
Dim docrow, doccount As Long
' Get the property set that we are interested in
Set PropertySet = dr.Environment.PropertySets.Item("Custom")
' Get the index of the property we want to read
indexAuthor = PropertySet.PropertyDefs.Index("Author")
' Get a TableView of all documents in the folder
Set AllDocumentInFolder = Folder.Elements(EFF_DOCSONLY, PropertySet)
' Get the number of documents
doccount = AllDocumentInFolder.RowCount
' The tableview contains all "Custom" properties for all documents in the folder
' We can get all property values in a single call to the server
AllProperties = AllDocumentInFolder.GetMultipleRowColumns(0, -1)
For docrow = 0 To (doccount - 1)
' now we can get all property values without an extra server call
Author = AllProperties(docrow)(indexAuthor + 4) ' Add 4 (the first 4 columns are fixed)
Next
' Or we can call the server for the property values of a single document in the tableview
docrow = 0 ' first document
Author = AllDocumentInFolder.GetRowColumn(docrow, indexAuthor + 2) ' Add 2 (the first 2 columns are fixed)
Related information
Accessing properties using the server object
Using the LoadProperties method
IAMTableViewCollection interface
Copyright © 2000-2012 BlueCielo ECM Solutions |