Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So, here is my version for anybody needing it

Sub LinkedPara
    dim oDoc as object
    dim oCursor as object
    dim oSelections as object
    dim oSel as object
    dim oPE as object
    dim oPar as object
    dim bAlready as boolean

    ' for reference
    ' MsgBox  vObj.dbg_methods              'Methods for this object.
    ' MsgBox  vObj.dbg_supportedInterfaces  'Interfaces for by this object.
    ' MsgBox  vObj.dbg_properties           'Properties for this object.

    oDoc = ThisComponent
    oSelections = oDoc.getCurrentSelection() 
    oSel = oSelections.getByIndex(0)    

    oPE = oSel.createEnumeration()
    bAlready = True
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        ' msgbox oPar.dbg_properties
        if not oPar.ParaKeepTogether then
            bAlready = False
            Exit do
        end if
    Loop
    'MsgBox "bAlready=" & bAlready, 64

    'msgBox oPE.dbg_methods
    oPE = oSel.createEnumeration()
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        oPar.ParaKeepTogether = not bAlready
        oPar.ParaKeepTogether = not bAlready
    Loop

End Sub

Feel free to correct me or enhance as this is my first macro for Libre Office.

So, here is my version for anybody needing it

 Sub LinkedPara
    dim oDoc as object
    dim oCursor as object
    dim oSelections as object
    dim oSel as object
    dim oPE as object
    dim oPar as object
    dim bAlready as boolean

    ' for reference
    ' MsgBox  vObj.dbg_methods              'Methods for this object.
    ' MsgBox  vObj.dbg_supportedInterfaces  'Interfaces for by this object.
    ' MsgBox  vObj.dbg_properties           'Properties for this object.

    oDoc = ThisComponent
    oSelections = oDoc.getCurrentSelection() 
    oSel = oSelections.getByIndex(0)    

    oPE = oSel.createEnumeration()
    bAlready = True
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        ' msgbox oPar.dbg_properties
        if not oPar.ParaKeepTogether then
            bAlready = False
            Exit do
        end if
    Loop
    'MsgBox "bAlready=" & bAlready, 64

    'msgBox oPE.dbg_methods
    oPE = oSel.createEnumeration()
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        oPar.ParaKeepTogether = not bAlready
        oPar.ParaKeepTogether = not oPar.ParaSplit = bAlready
    Loop

End Sub

Feel free to correct me or enhance as this is my first macro for Libre Office.

So, here is my version for anybody needing it


Sub LinkedPara
    dim oDoc as object
    dim oSelections as object
    dim oSel as object
    dim oPE as object
    dim oPar as object
    dim bAlready as boolean

    ' rem for reference
    ' MsgBox  vObj.dbg_methods              'Methods for this object.
    ' MsgBox  vObj.dbg_supportedInterfaces  'Interfaces for by this object.
    ' MsgBox  vObj.dbg_properties           'Properties for this object.

    oDoc = ThisComponent
    oSelections = oDoc.getCurrentSelection() 
    oSel = oSelections.getByIndex(0)    

    oPE = oSel.createEnumeration()
    bAlready = True
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        if not oPar.ParaKeepTogether then
            bAlready = False
            Exit do
        end if
    Loop
    'MsgBox "bAlready=" & bAlready, 64

    oPE = oSel.createEnumeration()
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        oPar.ParaKeepTogether = not bAlready
        oPar.ParaSplit = bAlready
    Loop

End Sub

Feel free to correct me or enhance as this is my first macro for Libre Office.

So, here is my version for anybody needing it


Sub LinkedPara
    dim oDoc as object
    dim oSelections as object
    dim oSel as object
    dim oPE as object
    dim oPar as object
    dim bAlready as boolean

    rem for reference
' for reference'
    ' MsgBox  vObj.dbg_methods              'Methods for this object.
    ' MsgBox  vObj.dbg_supportedInterfaces  'Interfaces for by this object.
    ' MsgBox  vObj.dbg_properties           'Properties for this object.

    oDoc = ThisComponent
    oSelections = oDoc.getCurrentSelection() 
    oSel = oSelections.getByIndex(0)    

    oPE = oSel.createEnumeration()
    bAlready = True
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        if not oPar.ParaKeepTogether then
            bAlready = False
            Exit do
        end if
    Loop
    'MsgBox "bAlready=" & bAlready, 64
64'

    oPE = oSel.createEnumeration()
    Do While oPE.hasMoreElements()
        oPar = oPE.nextElement()
        oPar.ParaKeepTogether = not bAlready
        oPar.ParaSplit = bAlready
    Loop

End Sub

Feel free to correct me or enhance as this is my first macro for Libre Office.