SSブログ

LibreOffice Writer Basic 表の挿入と項目設定するマクロの実験 [LibreOffice Writer Basic]

LibreOffice Writer Basic 表の挿入と項目設定するマクロの実験

OS LinuxMint18Cinnamon64bit
LibreOffice5.2

無題 1 - LibreOffice Writer_tableCell.png

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

 


nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:パソコン・インターネット

nice! 0

コメント 0

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

トラックバック 0


Linuxランキング

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。