LibreOffice Writer Basic 表の挿入と項目設定するマクロの実験 [LibreOffice Writer Basic]
LibreOffice Writer Basic 表の挿入と項目設定するマクロの実験
OS LinuxMint18Cinnamon64bit
LibreOffice5.2
Sub WriterTableTXT()
'write 3列20行の表を作成、項目テキスト挿入
Dim oTable As object
Dim oCurs As object
Dim oText As object
Dim oVCurs As object
Dim oCell As object
'oText
oText = ThisComponent.getText()
' 表作成
oTable = ThisComponent.createInstance("com.sun.star.text.TextTable")
'20行、3列
oTable.initialize(20, 3)
oCurs =ThisComponent.getCurrentController().getViewCursor()
oText.insertTextContent(oCurs, oTable, False)
' Table 選択
ThisComponent.getCurrentController().select(oTable)
oVCurs = ThisComponent.getCurrentController().getViewCursor()
'
' Cursor位置移動,文字列挿入 calc風 列、行
oCell1 = oTable.getCellByPosition(0,0)
oCell1.string="氏名"
oCell1 = oTable.getCellByPosition(1,0)
oCell1.string="TEL"
oCell1 = oTable.getCellByPosition(2,0)
oCell1.string="E-mail"
End Sub
コメント 0