1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| sub zazablues
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(4) as new com.sun.star.beans.PropertyValue
args1(0).Name = "CharFontName.StyleName"
args1(0).Value = ""
args1(1).Name = "CharFontName.Pitch"
args1(1).Value = 2
args1(2).Name = "CharFontName.CharSet"
args1(2).Value = -1
args1(3).Name = "CharFontName.Family"
args1(3).Value = 5
args1(4).Name = "CharFontName.FamilyName"
args1(4).Value = "Arial"
dispatcher.executeDispatch(document, ".uno:CharFontName", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(0).Name = "FontHeight.Height"
args2(0).Value = 16
args2(1).Name = "FontHeight.Prop"
args2(1).Value = 100
args2(2).Name = "FontHeight.Diff"
args2(2).Value = 0
dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Bold"
args3(0).Value = true
dispatcher.executeDispatch(document, ".uno:Bold", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "FontColor"
args4(0).Value = 128
dispatcher.executeDispatch(document, ".uno:FontColor", "", 0, args4())
rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "Text"
args5(0).Value = "zazaraigneé"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args5())
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "FontColor"
args6(0).Value = 128
dispatcher.executeDispatch(document, ".uno:FontColor", "", 0, args6())
end sub |
Partager