Stefan Weigel wrote:
> Um Dich zu retten, brauchst Du ein Makro, das alle 600 Vorlagen
> öffnet, den Titel daraus entfernt und wieder speichert.
>
> Für eine einzelne Vorlage sähe das so aus:
>
> sub TitelEntfernen()
>
> Dim oDesktop as object
> Dim oDocument as object
> Dim sSourceFile as string
>
> Dim myFileProp(0) As New com.sun.star.beans.PropertyValue
>
> oDesktop = createUnoService("com.sun.star.frame.Desktop")
> sSourceFile = "file:///... .ott" 'Pfad zur betrffenden Vorlage
> myFileProp(0).Name = "AsTemplate"
> myFileProp(0).Value = False
> oDocument = oDesktop.loadComponentFromURL( sSourceFile, "_blank",
> 0,myFileProp() )
>
> oDocument.getDocumentInfo().Title = ""
>
> oDocument.store()
> oDocument.close(false)
>
> end sub
>
> Wenn Du noch mehr Hilfe brauchst, melde Dich wieder. :-)
Mit OOo-Dokumenten geht das sogar einfacher und auch schneller, da nicht
das ganze Dokument geladen und gespeichert werden muss:
sub TitelEntfernen( sSourceFile As string )
dim info as object
info = createUnoService("com.sun.star.document.StandaloneDocumentInfo")
info.loadFromURL( sSourceFile )
info.setPropertyValue("Title", "")
info.storeIntoURL( sSourceFile )
end sub
sSourceFile muss natürlich in URL-Notation übergeben werden. Die kleine
Schleife außenrum (über alle Dateien deines Ordners) ist den Mitlesenden
zur Übung überlassen. :-)
Ciao,
Mathias
--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]