LibreOffice 25.2 Help
ThisComponent represents the current document in Basic macros. It addresses the active component whose properties can be read and set, and whose methods can be called. Properties and methods available through ThisComponent depend on the document type.
ThisComponent
When the active window is a Base form, query, report, table or view, ThisComponent returns the current Form information.
When active window is the Basic IDE, ThisComponent object returns the component owning the current script.
Sub Main
REM āĻĻā§āĻŦāĻžāĻ°āĻž āĻĒāĻžāĻ ā§āĻ¯ āĻ¨āĻĨāĻŋāĻ¤ā§ "āĻ¸ā§āĻāĻŋāĻĒāĻ¤ā§āĻ°" āĻšāĻžāĻ˛āĻ¨āĻžāĻāĻžāĻĻ āĻāĻ°āĻž āĻšā§
Dim allindexes, index As Object
allindexes = ThisComponent.getDocumentIndexes()
index = allindexes.getByName("Table of Contents1")
REM āĻ āĻ¸ā§āĻāĻŋāĻĒāĻ¤ā§āĻ° āĻāĻŦāĻ a 1 āĻāĻ° āĻāĻ¨ā§āĻ¯ āĻĒā§āĻ°ā§āĻŦāĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŋāĻ¤ āĻ¨āĻžāĻŽ āĻŦā§āĻ¯āĻŦāĻšā§āĻ¤ āĻšā§
index.update()
End Sub