Change Character Spacing using Macro

Hi,

i want to change the character spacing in libre office calc using a macro.
The change should affect the whole sheet but i guess i can figure the rest out if someone showed me how to change the caracter spacing for just one cell.

Best regards,
Sebastian

Hi

For the current cell:

sub SetSpacing
dim oCursor as object
oCursor = thiscomponent.currentselection.createTextCursor
oCursor.CharKerning = 60
end sub

Regards

Thank you very much!

Sadly i fail to use this knowledge to change the kerning for the entire sheet. I was hoping i could do it in the same way i change the font for the entire sheet:

ThisComponent.Sheets(0).CharFontName = ...

but obviously this does not work:

oCursor = ThisComponent.Sheets(0).createTextCursor

How can i change the kerning for the entire sheet?
There’s got to be a more elegant (and faster) way than do address every single cell in the sheet…

Best regards, Sebastian

Hi @Guilty_Spark_343

It is a text attribute (not cells). So I’m afraid there’s no other way than to go through these.

Regards