Hi Oner,
Aoo provides APIs to update the table of contents of an odt document.Please
access http://wiki.services.openoffice.org/wiki/Documentation/Wiki_Books to
download the OO3.1 Dev Guide and go to page 851..The type
"com.sun.star.text.ContentIndex" of Index is for table of contents..Then
you can access
http://www.openoffice.org/api/docs/common/ref/com/sun/star/text/module-ix.html
to
refer services of ContentIndex,BaseIndex and TextDocument, and also UNO
interface of XDocumentIndex and XTextDocument.

In your sample,you have gotten the TextDocument instance,and then you will
be able to instance the ContentIndex through TextDocument..Thus, you can
use the API "update" provided by  XDocumentIndex to update the table of
contents of the odt document...

I don't write the script like yours, and just provide their relations and
rough method..I hope it helpful to solve your problem...Thanks.

On Thu, May 31, 2012 at 10:38 PM, Олег Малёваный <[email protected]> wrote:

> Hi!
> I am developing a script that will generate the document. provided in
> the template "Table of Contents" of the document.
> In development, I use perl and module
> http://search.cpan.org/~jmgdoc/OpenOffice-OODoc-2.125/
> Can I by means of this module, update the "Table of Contents" in a
> document?
> If not, then how can one way to run a macro that will update the table
> of contents with the help of this module or the unix command line?
>
>

Reply via email to