Ask Your Question

Rouletabille's profile - activity

2018-08-13 07:16:01 +0100 received badge  Famous Question (source)
2018-02-24 07:29:03 +0100 received badge  Enthusiast
2018-02-21 10:41:39 +0100 edited answer Macro for keeping paragraphs together

So, here is my version for anybody needing it Sub LinkedPara dim oDoc as object dim oSelections as object

2018-02-21 10:40:45 +0100 edited answer Macro for keeping paragraphs together

So, here is my version for anybody needing it Sub LinkedPara dim oDoc as object dim oSelections as object

2018-02-21 08:26:14 +0100 edited question Macro for keeping paragraphs together

Macro for keeping paragraphs together I used to use a macro from myself in MSOffice to easily keep paragraphs together.

2018-02-21 07:48:08 +0100 marked best answer Macro for keeping paragraphs together

I used to use a macro from myself in MSOffice to easily keep paragraphs together. The macro was

Sub Paralie()

Dim p As Paragraph, bAlready As Boolean

bAlready = True
For Each p In Selection.Paragraphs
    If Not p.KeepTogether Then
        bAlready = False
        Exit For
    End If
Next

If bAlready Then
    'ParaLignesSolidaires 0
    'ParaSolidaires 0
    For Each p In Selection.Paragraphs
        p.KeepWithNext = False
        p.KeepTogether = False
    Next
Else
    'ParaLignesSolidaires 1
    'ParaSolidaires 1
    For Each p In Selection.Paragraphs
        p.KeepWithNext = True
        p.KeepTogether = True
    Next
End If

End Sub

I searched for the same in Libre Office and did not find.

The idea is to link the macro to a keyboard shortcut to easily switch a pack of paragraphs from being kept together or not. I do this very often to get a nice page formatting. E.g.

Title level1
some text
Title level2

It is frustrating to get the "Title level2" at the top of a page. Making the "some text" linked allows to avoid that.

2018-02-21 07:48:08 +0100 received badge  Scholar (source)
2018-02-21 07:46:30 +0100 commented answer Macro for keeping paragraphs together

Thank you @librebel for pointing my errors. I fixed the macro (and removed some debugging msgbox)

2018-02-21 07:43:39 +0100 edited answer Macro for keeping paragraphs together

So, here is my version for anybody needing it Sub LinkedPara dim oDoc as object dim oSelections as object

2018-02-21 07:34:04 +0100 commented question Macro for keeping paragraphs together

@ajlittoz: I use styles for about 30 years. My need is for specific cases as in my example. Or for bullet lists that I w

2018-02-21 07:10:22 +0100 commented question Macro for keeping paragraphs together

@ajlittoz: I use styles for about 30 years. My need is for specific cases as in my example. Or for bullet lists that I w

2018-02-20 23:19:08 +0100 received badge  Self-Learner (source)
2018-02-20 23:19:08 +0100 received badge  Teacher (source)
2018-02-20 22:36:48 +0100 received badge  Notable Question (source)
2018-02-20 20:57:11 +0100 commented question Macro for keeping paragraphs together

@ajlittoz: I use styles for about 30 years. My need is for specific cases as in my example. Or for bullet lists that I w

2018-02-20 19:59:25 +0100 received badge  Editor (source)
2018-02-20 19:59:25 +0100 edited question Macro for keeping paragraphs together

Macro for keeping paragraphs together I used to use a macro from myself in MSOffice to easily keep paragraphs together.

2018-02-20 19:58:03 +0100 commented question Macro for keeping paragraphs together

@ajlittoz: I use styles for about 30 years. My need is for specific cases as in my example. Or for bullet lists that I w

2018-02-20 19:51:17 +0100 received badge  Popular Question (source)
2018-02-20 19:51:10 +0100 answered a question Macro for keeping paragraphs together

So, here is my version for anybody needing it Sub LinkedPara dim oDoc as object dim oCursor as object dim o

2018-02-20 19:50:29 +0100 edited question Macro for keeping paragraphs together

Macro for keeping paragraphs together I used to use a macro from myself in MSOffice to easily keep paragraphs together.

2018-02-19 16:43:53 +0100 received badge  Student (source)
2018-02-19 15:38:30 +0100 commented question Macro for keeping paragraphs together

Should I reformulate as a question + a response?

2018-02-19 14:34:54 +0100 asked a question Macro for keeping paragraphs together

Macro for keeping paragraphs together I used to use a macro from myself in MSOffice to easily keep paragraphs together.