ODT ドキュメントに名前付きテーブルがあり、すべてのコンテンツを含む最後の行を新しい行 (上記) に複製し、この複製の一部の値を置き換えたいと考えています。
私はすでにDOCX用にWord/VBAでこれを行っています:
Dim tbl As Table
Dim rowNew As Row
Set tbl = ActiveDocument.Tables(1)
Set rowNew = tbl.Rows.Add(tbl.Rows(tbl.Rows.Count))
rowNew.Range.FormattedText = tbl.Rows(tbl.Rows.Count).Range.FormattedText
'~~~> This is required as the above code inserts a blank row in between
tbl.Rows(tbl.Rows.Count - 1).Delete
rowNew.Select
Selection.Find.Execute FindText:="xx*", ReplaceWith:="bar", MatchWildcards:=True
Selection.Collapse
これはLibreOfficeでも可能ですか? これまでのところ、私は持っています:
DIM tbl As Variant
DIM row As Variant
tbl = ThisComponent.getTextTables().getByIndex(0)
row = tbl.getRows().getByIndex(tbl.getRows().getCount()-1)
行全体を選択して複製し、この新しい行で検索と置換を実行するにはどうすればよいですか? ヒント: 行には、サブテーブルなどの他のオブジェクトが含まれる場合があります。