openoffice-users-de mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schmidt <joe...@j-m-schmidt.de>
Subject Re: Mehrere Formatvorlagen gleichzeitig löschen?
Date Sat, 23 Apr 2016 06:58:05 GMT
> From: Jörg Schmidt [mailto:joesch@j-m-schmidt.de] 

> Ich habe nun angeboten Dir ein komplett fertiges Makro zu 
> liefern was genau auf Deine Anfordertungen passt WENN Du mir 
> nur mitteilst wie die Vorlagen heißen die gelöscht werden müssen.
> Natürlich nicht im Einzelnen, sondern sowas wie: alle 
> entsprechenden Vorlagennamen beginnen mit "Convert" oder 
> ähnlicher Art der Beschreibung.

Da ich die gewünschten Namen immer noch nicht weiß, und um das Thema hier zumindest temporär
abzuschliesen, ist hier ein Makro das in Textdokumenten alle Vorlagen löschen sollte die
nicht zu den Default-Vorlagen gehören:

sub WT_Del_Formate
	Dim kkk
	Dim tt

	kkk = ""
	Dim AlleVorlagen() As String
	
	AlleVorlagen = Array("Standard", "Footnote Symbol", "Page Number", "Caption characters",
_
	"Drop Caps", "Numbering Symbols", "Bullet Symbols", "Internet link", "Visited Internet Link",
_
	"Placeholder", "Index Link", "Endnote Symbol", "Line numbering", "Main index entry", _
	"Footnote anchor", "Endnote anchor", "Rubies", "Vertical Numbering Symbols", "Emphasis",
_
	"Citation", "Strong Emphasis", "Source Text", "Example", "User Entry", "Variable", _
	"Definition", "Teletype", "Standard", "Heading", "Text body", "List", "Caption", "Index",
_
	"First line indent", "Hanging indent", "Text body indent", "Salutation", "Signature", _
	"List Indent", "Marginalia", "Heading 1", "Heading 2", "Heading 3", "Heading 4", _
	"Heading 5", "Heading 6", "Heading 7", "Heading 8", "Heading 9", "Heading 10", "Title", _
	"Subtitle", "Numbering 1 Start", "Numbering 1", "Numbering 1 End", "Numbering 1 Cont.", _
	"Numbering 2 Start", "Numbering 2", "Numbering 2 End", "Numbering 2 Cont.", _
	"Numbering 3 Start", "Numbering 3", "Numbering 3 End", "Numbering 3 Cont.", _
	"Numbering 4 Start", "Numbering 4", "Numbering 4 End", "Numbering 4 Cont.", _
	"Numbering 5 Start", "Numbering 5", "Numbering 5 End", "Numbering 5 Cont.", _
	"List 1 Start", "List 1", "List 1 End", "List 1 Cont.", "List 2 Start", "List 2", _
	"List 2 End", "List 2 Cont.", "List 3 Start", "List 3", "List 3 End", "List 3 Cont.", _
	"List 4 Start", "List 4", "List 4 End", "List 4 Cont.", "List 5 Start", "List 5", _
	"List 5 End", "List 5 Cont.", "Index Heading", "Index 1", "Index 2", "Index 3", _
	"Index Separator", "Contents Heading", "Contents 1", "Contents 2", "Contents 3", _
	"Contents 4", "Contents 5", "User Index Heading", "User Index 1", "User Index 2", _
	"User Index 3", "User Index 4", "User Index 5", "Contents 6", "Contents 7", _
	"Contents 8", "Contents 9", "Contents 10", "Illustration Index Heading", _
	"Illustration Index 1", "Object index heading", "Object index 1", _
	"Table index heading", "Table index 1", "Bibliography Heading", "Bibliography 1", _
	"User Index 6", "User Index 7", "User Index 8", "User Index 9", "User Index 10", _
	"Header", "Header left", "Header right", "Footer", "Footer left", "Footer right", _
	"Table Contents", "Table Heading", "Illustration", "Table", "Text", _
	"Frame contents", "Footnote", "Addressee", "Sender", "Endnote", "Drawing", _
	"Quotations", "Preformatted Text", "Horizontal Line", "List Contents", _
	"List Heading", "Standard", "First Page", "Left Page", "Right Page", _
	"Envelope", "Index", "HTML", "Footnote", "Endnote", "Landscape", "Frame", _
	"Graphics", "OLE", "Formula", "Marginalia", "Watermark", "Labels", _
	"Numbering 1", "Numbering 2", "Numbering 3", "Numbering 4", "Numbering 5", _
	"List 1", "List 2", "List 3", "List 4", "List 5")
	
	dim oStyleFamilies as object, oStyles as object
	dim aStNamen
	oStyleFamilies = thisComponent.getStyleFamilies
	for i = 0 to oStyleFamilies.getCount()-1
		oStyles = oStyleFamilies.getByIndex(i)
		REM Liste der Vorlagennamen innerhalb der Gruppe
		aStNamen() = oStyles.getElementNames()
		for j = 0 to uBound(aStNamen())
			tt = 0
			For k = 0 To UBOUND(AlleVorlagen())
				If aStNamen(j) <> AlleVorlagen(k) Then
					tt = tt + 1
				End If
			Next k
			'If aStNamen(j) = "jms1" Then Msgbox UBOUND(AlleVorlagen())
			If tt > UBOUND(AlleVorlagen()) Then
				oStyles.removeByName(aStNamen(j))
				kkk = kkk & CHR(34) & aStNamen(j) & CHR(34) & " - "
			End If
		next j
	next i	
	If kkk = "" Then kkk = "[Keine]"
	Msgbox "Gelöscht wurden die Vorlagen: " & CHR(13) & kkk
end sub



Gruß
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-de-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-de-help@openoffice.apache.org


Mime
View raw message