nach etwas praktischem Einsatz denke ich ein "Airbag" wäre noch ganz nützlich
sonst schrumpft es auch mal versehentlich eine ganze Seite auf eine Zeile zusammen

kann jetzt nicht mehr passieren
Code: Alles auswählen
Sub absatzstauchen ' mit "Airbag" !
odoc = thisComponent
oviewCursor = odoc.currentController.viewCursor()
oTcursor = odoc.text.createTextcursor()
oTcursor.gotorange( oviewcursor, false )
oTcursor.gotoStartofParagraph( false )
oTcursor.gotoEndofParagraph( true )
oviewcursor.gotoStartofline( false )
oviewcursor.gotoendofline( true )
if Instr( otcursor.string, chr( 10 )) then
rbreak = Instr( otcursor.string, chr( 10 ))
oTcursor.collapsetoStart()
oTcursor.goright( rbreak - 1 , true )
end if
scale = 100
while otcursor.string <> oviewcursor.string
'-----------------------------------------------------------------------------
if scale < 75 then
yn = MsgBox (" Text bereits um 25% gestaucht " & chr(13)_
& " passt trotzdem nicht in die Zeile " & chr(13)_
& " wieder auf 100% setzen? "_
, 36)
if yn = 7 then exit sub
if yn = 6 then oTcursor.CharScaleWidth = 100
exit sub
end if
'----------------------------------------------------------------------------
oviewcursor.gotostartofline( false )
scale = scale -1
oTcursor.CharScaleWidth = scale
oviewcursor.gotoendofline( true )
wend
End Sub
