Hallo Thomas,
dein script funktioniert zunächst einmal ganz gut, aber zum einen wird die Farbe für die Linien und den Text gleich gesetzt, was ich nicht möchte und zum anderenn habe ich auch keine Möglichkeit gefunden den Textfont (incl. Strichstärke) zu ändern.
deshalb mal hier meine Lösung in der Hoffnung, dass es dir vieleicht etwas weiter hilft.
Herzliche Grüße
Thomas
tab = CType(oman.GetTaggedObject(plist(0)), Annotations.Table)
Dim numRows As Integer
ufs.Tabnot.AskNmRows(tab.Tag, numRows)
Dim numCols As Integer
ufs.Tabnot.AskNmColumns(tab.Tag, numCols)
Dim tableSectionTag As Tag
ufs.Tabnot.AskNthSection(tab.Tag, 0, tableSectionTag)
ufs.Tabnot.EnableAutomaticUpdate(False)
'Liniendefinition: Color, font, width
cfw(0) = 2 '2 = grün
cfw(1) = 1
cfw(2) = 7 '7 = 0,25
For i As Integer = 0 To numRows - 1
Dim rowTag, rowTagvorher As Tag
ufs.Tabnot.AskNthRow(tab.Tag, i, rowTag)
If Not i = 0 Then
ufs.Tabnot.AskNthRow(tab.Tag, i - 1, rowTagvorher)
ufs.Tabnot.SetRowHeadCfw(rowTagvorher, cfw)
End If
ufs.Tabnot.SetRowHeadCfw(rowTag, cfw)
For j As Integer = 0 To numCols - 1
Dim colTag As Tag
ufs.Tabnot.AskNthColumn(tab.Tag, j, colTag)
Dim cellTag, cellTagvorher As Tag
ufs.Tabnot.AskCellAtRowCol(rowTag, colTag, cellTag)
If Not i = 0 Then
Dim theCellPrefs1 As UFTabnot.CellPrefs = Nothing
ufs.Tabnot.AskCellAtRowCol(rowTagvorher, colTag, cellTagvorher)
ufs.Tabnot.AskCellPrefs(cellTagvorher, theCellPrefs1)
If Not theCellPrefs1.bottom_line_cfw(0) = cfw(0) Then
theCellPrefs1.bottom_line_cfw = cfw
ufs.Tabnot.SetCellPrefs(cellTagvorher, theCellPrefs1)
End If
End If
'get the current cell preferences
Dim theCellPrefs As UFTabnot.CellPrefs = Nothing
ufs.Tabnot.AskCellPrefs(cellTag, theCellPrefs)
theCellPrefs.text_color = 6 '6 = gelb
theCellPrefs.bottom_line_cfw = cfw
theCellPrefs.right_line_cfw = cfw
theCellPrefs.text_density = 1
'apply the new settings to the cell
ufs.Tabnot.SetCellPrefs(cellTag, theCellPrefs)
'End If
Next
Next
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP