OpenOffice - individuelle Anpassungen

Schriftgröße per Tastatur ändern

Um die Schriftgröße, wie bei MS Office, per Tastatur ändern zu können muss diese Funktion explizit einer Tastenkombination zugewiesen werden.

Dazu unter ExtrasAnpassen → den Reiter Tastatur und darin eine freie Tastenkombination auswählen - hier bieten sich Strg+8 bzw. Strg+9 an (analog zu MSO).

Im Bereich → 'Format' auswählen
als Funktion → 'Zeichen verkleinern' resp. 'Zeichen vergrößern' auswählen

die Wahl mit Ändern bestätigen

Shift-F3 als Makro

MS Word bietet eine Funktion um per Shortcut die Groß-/Kleinschreibung eines Wortes oder ganzer Bereiche schnell und einfach zu ändern. OpenOffice fehlt diese Funktion. Mit dem folgenden Makro lässt sie sich jedoch nachrüsten. Dazu muss zunächst das Makro angelegt und anschließend ein Tastaturkürzel zugewiesen werden.

  1. Makro anlegen
    1. Extras → Makros → Makros verwalten → OpenOffice.org Basic
    2. Meine MakrosVerwaltenNeu
    3. Neu angelegtes Makro bearbeiten und Code einfügen
  2. Shortcut zuweisen
    1. ExtrasAnpassen → den Reiter Tastatur öffnen
    2. In Auswahlliste Tastenkombination „Umschalt + F3“ markieren
    3. Unter Funktion „OpenOffice.org Makros“ → user → Standard → TitleCase auswählen
    4. Button Ändern

Das Makro:

Sub CaseToggle
' CaseToggleMk3 phb 20070828
' Should preserve formatting and bookmarks in Writer
' Should work on text within a table in Writer (but not on whole cells)
' Should work on multiple words
' Does not handle non-contiguous text selection
   dim document,dispatcher,vcursor,oText,alpha,omega,ThisSeln,oBookmark As Object
   dim seln,nextword,nextbit as string
   dim loops,posn,nSelCount as integer
   dim ctogbmpv(0) as new com.sun.star.beans.PropertyValue
   On Error GoTo ExitPoint ' In case selection is not text
   nSelCount = thiscomponent.getCurrentSelection().getCount()
   if nSelCount>1 then
      msgbox ("There seems to be more than one piece of text selected." & _
      chr(10) & "Try making one selection.",0,"Case Conversion")
      goto ExitPoint
   endif
   loops=0
   document=ThisComponent.CurrentController.Frame
   dispatcher=createUnoService("com.sun.star.frame.DispatchHelper")
   vcursor=ThisComponent.currentcontroller.getViewCursor()
   ctogbmpv(0).Name="Bookmark"
   ctogbmpv(0).Value="ctogbm"
   dispatcher.executeDispatch(document, ".uno:DeleteBookmark", "", 0, ctogbmpv())
   dispatcher.executeDispatch(document, ".uno:InsertBookmark", "", 0, ctogbmpv())
GetSeln: ' Much here is taken from Andrew Brown and Andrew Pitonyak
   oText=vcursor.getText()
   alpha=vcursor.getStart()
   omega=vcursor.getEnd()
   ThisSeln=oText.createTextCursorByRange(alpha)
   ThisSeln.goToRange(omega,TRUE)
   seln=ThisSeln.getString()
   if seln<>"" then ' There is a selection - go and change case
      goto ChgCase
   endif ' make a selection to change
   dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
   dispatcher.executeDispatch(document, ".uno:WordLeftSel", "", 0, Array())
   loops=loops+1
   if loops=2 then goto FinishOff ' in case we failed to find any text to select
   goto GetSeln
ChgCase: 'Check case of seln and alter accordingly
   if seln=ucase(seln) then 'seln is already UPPER - set to lower
      dispatcher.executeDispatch(document, ".uno:ChangeCaseToLower", "", 0, Array())
      goto FinishOff
   endif
   if seln=lcase(seln) then 'seln is already lower - set to Title
      goto SetToTitle
   endif 'seln is probably mixed case - set to UPPER
      dispatcher.executeDispatch(document, ".uno:ChangeCaseToUpper", "", 0, Array())
      goto FinishOff
SetToTitle:
      vcursor.collapsetoStart()
      posn=0
      do while posn<len(seln)
         loops=0
         nextbit="1"
         do while nextbit=lcase(nextbit) and loops<2
            vcursor.goRight(1,TRUE)
            dispatcher.executeDispatch(document, ".uno:ChangeCaseToUpper", "", 0, Array())
            alpha=vcursor.getStart()
            omega=vcursor.getEnd()
            ThisSeln=oText.createTextCursorByRange(alpha)
            ThisSeln.goToRange(omega,TRUE)
            nextbit=ThisSeln.getString()
            loops=loops+1
         loop
            if instr(nextbit," ")>0 or instr(nextbit,chr(10))>0 then
               vcursor.goLeft(1,TRUE) ' To avoid problems due to punctuation marks
            endif
         dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
         alpha=vcursor.getStart()
         omega=vcursor.getEnd()
         ThisSeln=oText.createTextCursorByRange(alpha)
         ThisSeln.goToRange(omega,TRUE)
         nextword=ThisSeln.getString()
         posn=posn + len(nextword)
         vcursor.collapsetoEnd()
      loop
FinishOff: 'set vcursor back to the original position
   oBookmark=ThisComponent.getBookmarks().getByName("ctogbm")
   ThisComponent.getCurrentController().select(oBookmark)
   dispatcher.executeDispatch(document, ".uno:DeleteBookmark", "", 0, ctogbmpv())
ExitPoint:
end Sub
Quelle: OOo Forum

Navigation

Alphabetischer Index
Akronyme