Kopfzeile Speichern unter "Makro"

Programmierung unter AOO/LO (StarBasic, Python, Java, ...)

Moderator: Moderatoren

Doc12345
Beiträge: 6
Registriert: Sa, 30.04.2022 11:14

Kopfzeile Speichern unter "Makro"

Beitrag von Doc12345 »

moin @all,

ich brauche hilfe. ich würde gerne eine HTML seite unter writer öffnen (das kann ich), eine kopfzeile erstellen aus dem dateinemen (das kann ich auch) und dann die datei speichern unter (kopfzeile automatsch einfügen) kopfzeile.odt speichern und das als Makro. Bitte.

ich danke im vorraus für eure hilfe

Moderatorenhinweis:

Thema verschoben in den Bereich "Makros"
Toxitom
********
Beiträge: 3739
Registriert: Di, 12.08.2003 18:07
Wohnort: Wiesbaden
Kontaktdaten:

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Toxitom »

Hey Doc,

möchtest Du, dass Dir jemand Dein Makro schreibt oder brauchst Du konkret Hilfe zur Optimierung Deines Makros?

Dann wäre es gut, wenn Du schon mal postest, was Du bis jetzt geleistet hast :) Und... wie Deine Kopfzeile typischerweise aussieht;)

Das Forum hilft sicher gerne bei der Hilfe zur Selbsthilfe, aber ob Dir jemand die komplette Arbeit abnimmt??

Viele Grüße
Tom
Unterstützer LibreOffice, zertifizierter Trainer und Berater
Bücher: LibreOffice 6- Einstieg und Umstieg
Makros Grundlagen - LibreOffice / OpenOffice Basic
Doc12345
Beiträge: 6
Registriert: Sa, 30.04.2022 11:14

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Doc12345 »

bis jetzt habe ich leider nichts. ich habe den ganzen tag versucht mit Makro aufzeichnen und einstellungen (laden und speichen) was zu machen, habe aber nichts hinbekommen. habe auch keine idee mehr. ich brauche eine art anregung damit ich es schaffe. nicht unbedingt die komplette Arbeit. da kann ich ja nichts, oder nicht viel, von lernen :-)

nur konvertieren (HTML zu odt) geht auch!
Toxitom
********
Beiträge: 3739
Registriert: Di, 12.08.2003 18:07
Wohnort: Wiesbaden
Kontaktdaten:

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Toxitom »

Hey Doc,

nun, ich weiss nicht, wenn Du noch nie etwas Programmiert hast und Dich gar nicht mit der UNO Programmierung auskennst - ist das eher schwierig für Dich. Ist es dann nicht einfacher, nach dem Eintippen der Kopfzeile diese in die Zwischenablage zu kopieren (Ctlr + c), dann den Dialog zum Speichern aufrufen und den Dateinamen mittels Einfügen (ctlr- V) einfach reinzukopieren?

Aber gut... musst Du wissen.
Hier wäre das Grundgerüst für ein passendes Makro, die Lücken musst Du halt selbst füllen entsprechend Deiner Umgebungen etc.

Code: Alles auswählen

  REM Zugriff auf das aktuelle Dokument
  oDoc = thisComponent
  REM Name der verwendeten Seitenvorlage
  sVorlage = oDoc.text.Start.PageStyleName
  REM Objekt der Seitenvorlag
  oSeitenVorlage = oDoc.getStyleFamilies.getByName("PageStyles").getByName(sVorlage)
  REM Text der Kopfzeile der Seitenvorlage
  sKopfzeilenText = oSeitenVorlage.HeaderText.String
  REM ... hier folgt jetzt die Aufarbeitung des Headertextes so dass er als Dateinamensbestandteil passt!
  '...
  '...
  REM Zusammenbau des Dateinamens:
  sDatName = sKopfzeilentext & ".odt" 
  REM Aufbau der URL zum Speichern
  sURL = convertToURL("der/gewünschte/ausführliche/Pfad/" & sDatName)
  REM jetzt folgt zunächst die Prüfung, ob es die Datei schon gibt, 
  REM ob der Pfad gültig und existiert etc....
  '....
  '....
  
  REM Speichern des Dokumentes
  oDoc.storeAsURL(sUrl, arg())
Viele Grüße
Tom
Unterstützer LibreOffice, zertifizierter Trainer und Berater
Bücher: LibreOffice 6- Einstieg und Umstieg
Makros Grundlagen - LibreOffice / OpenOffice Basic
Doc12345
Beiträge: 6
Registriert: Sa, 30.04.2022 11:14

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Doc12345 »

ich danke dir Toxitom.

bis jetzt hatte ich nur das!

Code: Alles auswählen

sub Makro

Kopfzeile

Schrift01

A01
A02
A03
A04
A05
A06
A07
A08
A09
A10

B10
B11

B01
B02
B03
B04
B05
B06
B07
B08
B09

Sterne

Speichern

Schliessen

end sub

sub Alles

dim document   as object
dim dispatcher as object

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dispatcher.executeDispatch(document, ".uno:SelectAll", "", 0, Array())

end sub

sub Kopfzeile
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(5) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Type"
args1(0).Value = 2
args1(1).Name = "SubType"
args1(1).Value = 0
args1(2).Name = "Name"
args1(2).Value = ""
args1(3).Name = "Content"
args1(3).Value = ""
args1(4).Name = "Format"
args1(4).Value = 3
args1(5).Name = "Separator"
args1(5).Value = " "

dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args1())


end sub

sub Schrift01
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SelectAll", "", 0, Array())

rem ----------------------------------------------------------------------
dim args2(4) as new com.sun.star.beans.PropertyValue
args2(0).Name = "CharFontName.StyleName"
args2(0).Value = ""
args2(1).Name = "CharFontName.Pitch"
args2(1).Value = 2
args2(2).Name = "CharFontName.CharSet"
args2(2).Value = -1
args2(3).Name = "CharFontName.Family"
args2(3).Value = 5
args2(4).Name = "CharFontName.FamilyName"
args2(4).Value = "Arial"

dispatcher.executeDispatch(document, ".uno:CharFontName", "", 0, args2())

rem ----------------------------------------------------------------------
dim args3(2) as new com.sun.star.beans.PropertyValue
args3(0).Name = "FontHeight.Height"
args3(0).Value = 10
args3(1).Name = "FontHeight.Prop"
args3(1).Value = 100
args3(2).Name = "FontHeight.Diff"
args3(2).Value = 0

dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, args3())

rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Bold"
args4(0).Value = true

dispatcher.executeDispatch(document, ".uno:Bold", "", 0, args4())

rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "Bold"
args5(0).Value = false

dispatcher.executeDispatch(document, ".uno:Bold", "", 0, args5())

rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Italic"
args6(0).Value = true

dispatcher.executeDispatch(document, ".uno:Italic", "", 0, args6())

rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "Italic"
args7(0).Value = false

dispatcher.executeDispatch(document, ".uno:Italic", "", 0, args7())

rem ----------------------------------------------------------------------
dim args8(2) as new com.sun.star.beans.PropertyValue
args8(0).Name = "Underline.LineStyle"
args8(0).Value = 1
args8(1).Name = "Underline.HasColor"
args8(1).Value = false
args8(2).Name = "Underline.Color"
args8(2).Value = -1

dispatcher.executeDispatch(document, ".uno:Underline", "", 0, args8())

rem ----------------------------------------------------------------------
dim args9(2) as new com.sun.star.beans.PropertyValue
args9(0).Name = "Underline.LineStyle"
args9(0).Value = 0
args9(1).Name = "Underline.HasColor"
args9(1).Value = false
args9(2).Name = "Underline.Color"
args9(2).Value = -1

dispatcher.executeDispatch(document, ".uno:Underline", "", 0, args9())

end sub

Sub Sterne
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

sub Speichern

dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Save", "", 0, Array())

end sub

sub Schliessen
  myDoc= ThisComponent
  wait(1000)
  myDoc.close(true)
end sub

Sub A01
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 1 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A02
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 2 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A03
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 3 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A04
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 4 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A05
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 5 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A06
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 6 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A07
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 7 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A08
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 8 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A09
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 9 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A10
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A11
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A12
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A13
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A14
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A15
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A16
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A17
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A18
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A19
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

Sub A20
  oDescriptor = ThisComponent.createSearchDescriptor()
  oDescriptor.SearchString = "***** Page 10 *****"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For i = 0 To oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(i)
    oFound.setString("")
  Next
End Sub

sub B01
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "ü"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "ü"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B02
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "ß"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "ß"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B03
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "ä"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "ä"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B04
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "ö"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "ö"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B05
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "Ü"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "Ü"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B06
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "„"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = CHR$(34)
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())

end sub

sub B07
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "Ä"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "Ä"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B08
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "é"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "é"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B09
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "Ö"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = "Ö"
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B10
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "'"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = CHR$(34)
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub

sub B11
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(18) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.StyleFamily"
args1(0).Value = 2
args1(1).Name = "SearchItem.CellType"
args1(1).Value = 0
args1(2).Name = "SearchItem.RowDirection"
args1(2).Value = true
args1(3).Name = "SearchItem.AllTables"
args1(3).Value = false
args1(4).Name = "SearchItem.Backward"
args1(4).Value = false
args1(5).Name = "SearchItem.Pattern"
args1(5).Value = false
args1(6).Name = "SearchItem.Content"
args1(6).Value = false
args1(7).Name = "SearchItem.AsianOptions"
args1(7).Value = false
args1(8).Name = "SearchItem.AlgorithmType"
args1(8).Value = 0
args1(9).Name = "SearchItem.SearchFlags"
args1(9).Value = 65536
args1(10).Name = "SearchItem.SearchString"
args1(10).Value = "'"
args1(11).Name = "SearchItem.ReplaceString"
args1(11).Value = CHR$(34)
args1(12).Name = "SearchItem.Locale"
args1(12).Value = 255
args1(13).Name = "SearchItem.ChangedChars"
args1(13).Value = 2
args1(14).Name = "SearchItem.DeletedChars"
args1(14).Value = 2
args1(15).Name = "SearchItem.InsertedChars"
args1(15).Value = 2
args1(16).Name = "SearchItem.TransliterateFlags"
args1(16).Value = 1280
args1(17).Name = "SearchItem.Command"
args1(17).Value = 3
args1(18).Name = "Quiet"
args1(18).Value = true

dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())


end sub
Doc12345
Beiträge: 6
Registriert: Sa, 30.04.2022 11:14

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Doc12345 »

leider komme ich damit nicht zurecht. ich schaffe das nicht! ich denke ich brauche den vollen weg. das volle makro. :-(
Toxitom
********
Beiträge: 3739
Registriert: Di, 12.08.2003 18:07
Wohnort: Wiesbaden
Kontaktdaten:

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Toxitom »

Das war das volle Makro. Die Lücken (z.B. den Pfad) kannst nur Du füllen. Musst halt noch ein "sub Makroname... end sub" drum herum packen.
Unterstützer LibreOffice, zertifizierter Trainer und Berater
Bücher: LibreOffice 6- Einstieg und Umstieg
Makros Grundlagen - LibreOffice / OpenOffice Basic
Doc12345
Beiträge: 6
Registriert: Sa, 30.04.2022 11:14

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Doc12345 »

Das Makro sagt immer

"BASIC-Laufzeitfehler.
Objektvariable nicht belegt.

und hällt immer bei
sKopfzeilenText = oSeitenVorlage.HeaderText.String

oder

oDoc.storeAsURL(sUrl, args1())
Doc12345
Beiträge: 6
Registriert: Sa, 30.04.2022 11:14

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Doc12345 »

oder schreibe bitte, das makro mit ein paar beispiele
ich hoffe das ich das dann verstehe. (je älter ich werde desto schwerer wird es) :-(
Toxitom
********
Beiträge: 3739
Registriert: Di, 12.08.2003 18:07
Wohnort: Wiesbaden
Kontaktdaten:

Re: Kopfzeile Speichern unter "Makro"

Beitrag von Toxitom »

Die Makrozeilen waren vollständig und gut kommentiert...was möchtest Du denn für Beispiele?

Mach es lieber mal andersherum:

Lade Deine Datei hier hoch mit den Makros - dann kann man evt. schauen, wo Deine Probleme liegen. Und erkläre, wie Du sie aufrufst (die Makros). Dazu bitte Betriebssystem und Programmversion.

Die Datei sollte natürlich keine persönlichen Daten enthalten - also bitte entsprechend anomysieren! Sie ist dannhier öffentlich zugänglich!
Unterstützer LibreOffice, zertifizierter Trainer und Berater
Bücher: LibreOffice 6- Einstieg und Umstieg
Makros Grundlagen - LibreOffice / OpenOffice Basic
Antworten