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
This entry was posted in OO Basic, OO Writer, OpenOffice. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>