Stel uw vraag

Rouletabille's profiel - activiteit

2018-08-13 07:16:01 +0200 badge ontvangen  Beroemde vraag (bron)
2018-02-24 07:29:03 +0200 badge ontvangen  enthousiast
2018-02-21 10:41:39 +0200 bewerkte een antwoord 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 +0200 bewerkte een antwoord 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 +0200 bewerkte een vraag 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 +0200 koos een beste antwoord 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 +0200 badge ontvangen  Leerling (bron)
2018-02-21 07:46:30 +0200 reageerde op een antwoord 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 +0200 bewerkte een antwoord 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 +0200 reageerde op een vraag 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 +0200 reageerde op een vraag 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 +0200 badge ontvangen  Zelflerend (bron)
2018-02-20 23:19:08 +0200 badge ontvangen  Leraar (bron)
2018-02-20 22:36:48 +0200 badge ontvangen  Opvallende Vraag (bron)
2018-02-20 20:57:11 +0200 reageerde op een vraag 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 +0200 badge ontvangen  Redacteur (bron)
2018-02-20 19:59:25 +0200 bewerkte een vraag 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 +0200 reageerde op een vraag 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 +0200 badge ontvangen  Populaire Vraag (bron)
2018-02-20 19:51:10 +0200 beantwoorde een vraag 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 +0200 bewerkte een vraag 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 +0200 badge ontvangen  Student (bron)
2018-02-19 15:38:30 +0200 reageerde op een vraag Macro for keeping paragraphs together

Should I reformulate as a question + a response?

2018-02-19 14:34:54 +0200 stelde een vraag 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.