Makro - wo ist der Fehler
Verfasst: Do 22. Aug 2019, 09:16
Hallo zusammen,
ich habe ein Makro aufgezeichet mit dem ich folgende Schritte ausführen möchte:
1. Tabellenblatt markieren - funktioniert
2. Schrift auf Courier 12 ändern - funktioniert
3. Spaltenbreite anpassen - funktioniert nicht
Wer kann mir helfen?
Gruß Ulrich
sub Courier12
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 = 1
args2(2).Name = "CharFontName.CharSet"
args2(2).Value = -1
args2(3).Name = "CharFontName.Family"
args2(3).Value = 2
args2(4).Name = "CharFontName.FamilyName"
args2(4).Value = "Courier New"
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 = 12
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())
end sub
ich habe ein Makro aufgezeichet mit dem ich folgende Schritte ausführen möchte:
1. Tabellenblatt markieren - funktioniert
2. Schrift auf Courier 12 ändern - funktioniert
3. Spaltenbreite anpassen - funktioniert nicht
Wer kann mir helfen?
Gruß Ulrich
sub Courier12
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 = 1
args2(2).Name = "CharFontName.CharSet"
args2(2).Value = -1
args2(3).Name = "CharFontName.Family"
args2(3).Value = 2
args2(4).Name = "CharFontName.FamilyName"
args2(4).Value = "Courier New"
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 = 12
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())
end sub