Bonjour,
Un extrait reconstitué et utilisable :
sub es2
Dim oDoc as Object
oDoc = ThisComponent
Dim oText as Object
oText = oDoc.Text
Dim oCursor as Object
oCursor = oText.createTextCursor
Dim oCurSelection as Object
oCurSelection = thisComponent.getCurrentSelection()
'https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1text_1_1DocumentIndexMark.html#a120a1795ce3b74d5569c626f3316fed0
Dim oIndexEntry as Object
oIndexEntry = oDoc.createInstance( "com.sun.star.text.DocumentIndexMark")
oIndexEntry.AlternativeText = "MonEntree"
oDoc.text.insertTextContent( oCursor, oIndexEntry, TRUE)
oCursor.GotoEnd( FALSE)
oText.insertControlCharacter(oCursor,_
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, FALSE)
oText.insertControlCharacter(oCursor,_
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, FALSE)
oCursor.goLeft(1, FALSE)
Dim oIndex as Object
oIndex = oDoc.createInstance("com.sun.star.text.DocumentIndex")
oIndex.UseCombinedEntries = TRUE
oIndex.Title = "Index"
oIndex.UsePP = TRUE
oText.insertTextContent(oCursor, oIndex, FALSE)
oIndex.update()
end sub
Le 05/02/2018 à 14:45, Stéphane Santon a écrit :
https://api.libreoffice.org/examples/basic/text/creating_an_index/
Le 05/02/2018 à 11:33, Stéphane Santon a écrit :
Pour écrire une macro, où trouver les paramètres de
.uno:InsertIndexesEntry ?
--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/users/
Tous les messages envoyés sur cette liste seront archivés publiquement et ne pourront pas être
supprimés
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.