我正在 NeoOffice(一个 mac OO 克隆)中编写一个 Basic 宏,我想突出显示/选择宏运行时光标所在的表格中的单元格。
谷歌给了我以下相关的片段,它确实为单元格着色,但我想像使用鼠标一样选择/突出显示它。我觉得我在正确的轨道上...
Sub selectCell
Dim the_Cursor As Object
Dim the_CurCell As Object
the_CurCell=thisComponent.currentSelection(0).cell
the_Cursor=the_CurCell.CreateTextCursorByRange(the_CurCell.start)
the_Cursor.GoRight(1, true) 'le curseur recouvre toute la cellule
the_Cursor.GoLeft(1, true) 'le curseur recouvre toute la cellule
'the_CurCell.setPropertyValue("BackColor", 16711935) ' Magenta clair / Light Magenta
End Sub
有任何想法吗?
PS:我正在运行 NeoOffice v3.3,它应该基于相同版本的 OO。