|
セル全体のフォント等を変更するには、以下のようにすればOKでした。
だけど、やりたいのは、セル内の文字列を *部分的に* 変更することなんですよねぇ...
' セルのフォントを変更する
Public Sub SetFont(ByVal sheetName As String, ByVal cellRange As String, ByVal fontName As String)
Dim sheet As XSpreadsheet = Me.GetSheet(sheetName)
Dim range = sheet.getCellRangeByName(cellRange)
Dim xProps As XPropertySet = DirectCast(range, XPropertySet)
xProps.setPropertyValue("CharFontName", New uno.Any(fontName))
xProps.setPropertyValue("CharFontNameAsian", New uno.Any(fontName))
End Sub
' セルを太字にする
Public Sub SetBold(ByVal sheetName As String, ByVal cellRange As String)
Dim sheet As XSpreadsheet = Me.GetSheet(sheetName)
Dim range = sheet.getCellRangeByName(cellRange)
Dim xProps As XPropertySet = DirectCast(range, XPropertySet)
xProps.setPropertyValue("CharWeight", New uno.Any(FontWeight.BOLD))
xProps.setPropertyValue("CharWeightAsian", New uno.Any(FontWeight.BOLD))
End Sub
|