Advertisement
paul1149

Macro: IndexMark

Feb 12th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. edited
  2. Sub SetIndex
  3. oSelection = ThisComponent.CurrentController.Selection
  4. oIndex =ThisComponent.createInstance("com.sun.star.text.ContentIndexMark")
  5. xEntry.setPropertyValue ( "Level", new Short ( (short) 4 ) )
  6. for Int1 = 0 to oSelection.Count -1
  7. oSel1 = oSelection (Int1)
  8. if HasUnoInterfaces(oSel1,"com.sun.star.text.XTextRange") Then
  9. ThisComponent.Text.InsertTextContent(oSel1, oIndex, True)
  10. end If
  11. Next Int1
  12. Update_Index 'Call Sub Update_Index
  13. End Sub
  14.  
  15. sub Update_Index
  16. dim document as object
  17. dim dispatcher as object
  18. document = ThisComponent.CurrentController.Frame
  19. dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
  20. dispatcher.executeDispatch(document, ".uno:UpdateAllIndexes", "", 0, Array())
  21. end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement