Listing Tables and Indexes

Here’s a piece of code I adapted from the “Programming Guide to BASIC.” It didn’t actually prove to get me anywhere I wanted to go, but it might help in some other effort. This one simply iterates all indexes and tables in a document.

'Just a simple routine I wrote along the way as I was learning document structure
Sub ShowIndex
Dim Doc As Object
Dim Indexes As Object
Dim Index As Object
Dim I As Integer
Dim C As Integer

Doc = StarDesktop.CurrentComponent
Indexes = Doc.getDocumentIndexes()
C = Indexes.getCount() - 1
for I=0 to C
	Index = Indexes.getByIndex(I)
	MsgBox Index.Title + " - " + Index.ContentSection
next I
End Sub

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.