Please,
I have this macro and I want it to be applied only in the footnote area:
Sub MyStyles
Dim oDoc as Object
Dim oText as object
Dim oPar as object
Dim bAlternate as boolean
oDoc = ThisComponent
oText = oDoc.getText()
bAlternate = false
oParEnum = oText.createEnumeration()
Do While oParEnum.hasMoreElements()
oPar = oParEnum.nextElement()
REM This avoids the tables. Add an else statement if you want to process the tables.
If oPar.supportsService("com.sun.star.text.Paragraph") Then
If bAlternate then
oPar.ParaStyleName = "MyStyle1"
else
oPar.ParaStyleName = "MyStyle2"
end if
end if
bAlternate = not bAlternate
loop
end Sub
I studied Andrew Pitonyak’s files and found this code:
oNotes = ThisComponent.getFootnotes()
For i = 0 To oNotes.getCount() - 1
oNote = oNotes.getByIndex(i)
And also this:
fnotes=xdoc.getFootNotes()
If fnotes.hasElements() Then
fnotecount=0
For nfnotes=0 To fnotes.getCount()-1
thisnote=fnotes.getbyIndex(nfnotes)
startcursor=thisnote.getStart()
But I can’t get it to work in the above Macro. Can anyone help, please?
Thanks,