Changing the Font of schedule headers with SetCellStyle

Changing the Font of schedule headers with SetCellStyle

david_rock
Enthusiast Enthusiast
245 Views
0 Replies
Message 1 of 1

Changing the Font of schedule headers with SetCellStyle

david_rock
Enthusiast
Enthusiast

Hello,

I have project with hundreds of schedules created with the rows in the headers.

I would like to use the following code to change the font of each of the cells in the headers.

 

For intHeaderRow As Integer = 0 To intScheduleRowColumnCountHeaderRows
    For intHeaderColumn As Integer = 0 To intScheduleRowColumnCountHeaderColumns
        Dim objTableCellStyle As TableCellStyle = objTableSectionData.GetTableCellStyle(intHeaderRow, intHeaderColumn)
        If Not objTableCellStyle.FontName.Equals(strNewFontName) Then
            If objTableSectionData.AllowOverrideCellStyle(intHeaderRow, intHeaderColumn) Then
                Dim options As TableCellStyleOverrideOptions = New TableCellStyleOverrideOptions With {
                    .FontSize = False
                }
                objTableCellStyle.FontName = strNewFontName
                objTableCellStyle.SetCellStyleOverrideOptions(options)
                objTableSectionData.SetCellStyle(intHeaderRow, intHeaderColumn, objTableCellStyle)
            End If
        End If
    Next
Next

This code works well & changes the font, however it does not preserve the size or the boldness of the cell.

The size gets changed to the same as what is set in the schedule appearance header text.

Any ideas?

Kind Regards

David

0 Likes
246 Views
0 Replies
Replies (0)