Hallo Andreas,
>
> Daf�r ben�tige ich ein Makro, welches /in einem Rutsch/ alle Makros
> f�r alle Standard-Formatvorlagen erzeugt. Damit ist schon viel
> gewonnen.
Dann bist Du ja einfach zufrieden zu stellen, Das Makro hier macht das:
Sub test
xxx = ThisComponent.StyleFamilies.getByName("ParagraphStyles")
cursor = ThisComponent.text.CreateTextCursor
cursor.GotoStart(False)
For i = 0 to xxx.Count-1
ndf = Trim(xxx.GetByIndex(i).DisplayName)
alles = ""
For j=1 to Len(ndf)
teil = Left(ndf,j)
teil2 = Right(teil,1)
if teil2 = " " Then teil2 = "_"
if Teil2 = "�" Then Teil2 = "oe"
if Teil2 = "�" Then Teil2 = "ue"
if teil2 = "�" Then Teil2 = "ae"
If teil2 = "�" Then teil2 = "Oe"
If teil2 = "�" Then teil2 = "Ue"
If teil2 = "�" Then teil2 = "Ae"
alles = alles & teil2
Next j
Cursor.String = "Sub " & alles
Cursor.GotoEndofParagraph(False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
Cursor.String = " SetCurrentParaStyle(" & CHR(34) & _
xxx.GetByIndex(i).Name & CHR(34) & ")"
Cursor.GotoEndofParagraph(False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
Cursor.String = "End Sub"
Cursor.GotoEndofParagraph(False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
Next i
Cursor.String = "Function SetCurrentParaStyle (NewStyle)"
Cursor.GotoEndofParagraph(False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
Cursor.String = _
" oVCursor = thisComponent.currentcontroller.getViewCursor" & _
".paraStyleName = NewStyle"
Cursor.GotoEndofParagraph(False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
Cursor.String = "End Function"
Cursor.GotoEndofParagraph(False)
ThisComponent.Text.insertControlCharacter(Cursor, _
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
End sub
Das ist jetzt nur f�r alle Absatzvorlagen, weil Du ja sonst zun�chst
nachdenken mu�t was wie im Dokument markiert werden mu�.
Pack das Makro in die Bibliothek eines leeren Textdokuments, starte es
und im Textdokument stehen alle Makros die Du brauchst. Kopiere diese in
eine Bibliothek Deiner Wahl und fertig.
(auf das Zuweisen von Ebenen habe ich in der Funktion jetzt verzichtet,
weil ich das ohne Pr�fung f�r ung�nstig halte)
Gru�
J�rg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]