回复 3楼dodo的帖子
下面是 TX ActiveX 针对 Table 操作的示例代码:
- '
- //选择 table
- Private Sub SelectTable(tx As TXTextControl)
- With tx
- .SelStart = .TableCellStart(.TableAtInputPos, 1, 1) - 1
- .SelLength = .TableCellStart(.TableAtInputPos, .TableRows(.TableAtInputPos), .TableColumns(.TableAtInputPos)) + _
- .TableCellLength(.TableAtInputPos, .TableRows(.TableAtInputPos), .TableColumns(.TableAtInputPos)) + _
- -.SelStart - 1
- End With
- End Sub
- //选择 row
- Private Sub SelectTableRow(tx As TXTextControl)
- With tx
- .SelStart = .TableCellStart(.TableAtInputPos, .TableRowAtInputPos, 1) - 1
- .SelLength = .TableCellStart(.TableAtInputPos, .TableRowAtInputPos, .TableColumns(.TableAtInputPos)) + _
- .TableCellLength(.TableAtInputPos, .TableRowAtInputPos, .TableColumns(.TableAtInputPos)) + _
- -.SelStart - 1
- End With
- End Sub
- //选择 col
- Private Sub SelectTableColumn(tx As TXTextControl)
- With tx
- .SelStart = .TableCellStart(.TableAtInputPos, 1, .TableColAtInputPos) - 1
- .SelLength = .TableCellStart(.TableAtInputPos, .TableColumns(.TableAtInputPos), .TableColAtInputPos) + _
- .TableCellLength(.TableAtInputPos, .TableColumns(.TableAtInputPos), .TableColAtInputPos) + _
- -.SelStart - 1
- End With
- End Sub
- //选择 cell
- Private Sub SelectTableCell(tx As TXTextControl)
- With tx
- .SelStart = .TableCellStart(.TableAtInputPos, .TableRowAtInputPos, .TableColAtInputPos) - 1
- .SelLength = .TableCellLength(.TableAtInputPos, .TableRowAtInputPos, .TableColAtInputPos)
- End With
- End Sub
复制代码 |