In relation to my query I experimented a bit with the recent macro recorder and trimmed its bloated output to get the following macro which sure enough applies bold to cells O4 to O45 in all 12 of my sheets.
sub addTithiBold
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:JumpToFirstTable", "", 0, Array())
dim selectCells(0) as new com.sun.star.beans.PropertyValue
dim addBoldAttr(0) as new com.sun.star.beans.PropertyValue
selectCells(0).Name = "ToPoint"
selectCells(0).Value = "$O$4:$O$45"
addBoldAttr(0).Name = "Bold"
addBoldAttr(0).Value = true
sheet = 1
do
if sheet <> 1 then dispatcher.executeDispatch(document, ".uno:JumpToNextTable", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, selectCells())
dispatcher.executeDispatch(document, ".uno:Bold", "", 0, addBoldAttr())
sheet = sheet + 1
loop while sheet < 13
end sub
However I want to apply bold only to cells with particular textual content. Based on the solution given to my query, I was able to add the line:
if oCell.string = "पौर्णमासी" or oCell.string = "अमावास्या" then oCell.charWeight = com.sun.star.awt.FontWeight.BOLD else oCell.charWeight = com.sun.star.awt.FontWeight.NORMAL
but as I have noted in that answer, this is not sufficient to apply faux bold when the font itself does not provide a separate proper bold. However the above dispatch method produced by the macro recorder is able to apply faux bold. Now I’d like to know how to apply the dispatch method by selecting cells with a particular textual content.
Or if there is any other method also to get the required faux bold I’d be happy.
Thanks.