For everyone interested, the following basic macro works:
Sub Main
Dim oDocIndexes as Object
Dim oIndex as Object
Dim iIndexCount as Integer
REM get all document indexes
oDocIndexes = thisComponent.getDocumentIndexes()
REM counter
iIndexCount = oDocIndexes.getCount()
REM refresh every index
while (iIndexCount > 0)
iIndexCount = iIndexCount - 1
oDocIndexes.getByIndex(iIndexCount).update()
Wend
End Sub
Cheers
Harald
Harald Weyhing wrote:
Hi all,
In our application we generate documents via XSLT and template
documents. In one case there is a table of contents that needs to get
updated during loading the document. We try to achieve this with a
basic macro in the document connected to the load event:
sub VerzeichnisAktualisieren
rem
----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem
----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem
----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:UpdateAllIndexes", "", 0,
Array())
This works perfectly when I use OOo as application loading a file, but
does not work when loading a byte[] with OOoBean. Is this a bug or is
ther another way to refresh the table of contents during load of a
byte[]?
Thanks in advance
Cheers
Harald
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]