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
| sub taille_caract(page as integer,xj as integer,y as integer,dx as integer,dy as integer,taille_c as single)
rem page : numéro de la feuille (xj,y) coordonnées du point de départ (dx,dt) taille de la plage de cellules à modifier, taille_c : taille de la police de caractères
rem define variables
dim document as object
dim dispatcher as object
dim xf as string
dim i,j as integer
dim x as string
j=xj+1
x=""
while j>25
x=x+chr$(asc("A")+(j-1) mod 26)
j=j/26
wend
x= "$"+chr$(asc("A")+j-1)+x+"$"+y
j=xj+dx+1
xf=""
while j>25
xf=xf+chr$(asc("A")+(j-1) mod 26)
j=j/26
wend
xf=x+":$"+chr$(asc("A")+j-1)+xf+"$"+(y+dy)
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Nr"
args1(0).Value = page+1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = xf
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(2) as new com.sun.star.beans.PropertyValue
args3(0).Name = "FontHeight.Height"
args3(0).Value = taille_c
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 |
Partager