セクション 
セクションは段落を含むドキュメントの一部分です。Writer ではもっとも大きなフォーマットされる構造になります。
セクションは他のドキュメントのセクションをリンクしたり、列に区切ったりといったことができます。
セクションコンテナ 
ドキュメントに存在するセクションすべてをまとめるセクションコンテナオブジェクトにドキュメントオブジェクトの TextSections プロパティでアクセスできます。
Sub textsection_5
oDoc = ThisComponent
oSections = oDoc.getTextSections()
End Sub
個々のセクションは com.sun.star.container.XIndexAccess および com.sun.star.container.XNameAccess で管理されています。
セクションの挿入 
セクションは com.sun.star.text.TextSection サービスです。このサービスをインスタンス化してテキストコンテンツとして挿入します。
Sub textsection_1
oDoc = ThisComponent
oText = oDoc.getText()
oEnd = oText.getEnd()
oSection = oDoc.createInstance("com.sun.star.text.TextSection")
oSection.Name = "New_Section1"
oText.insertTextContent(oEnd,oSection,False)
End Sub
セクションの削除 
セクションの削除はセクションコンテナなどからセクションオブジェクトを取得し、removeTextContent メソッドで削除します。
Sub textsections_4
oDoc = ThisComponent
oText = oDoc.getText()
oSections = oDoc.TextSections
sNames = oSections.getElementNames()
For i = 0 To UBound(sNames)
oSection = oSections.getByName(sNames(i))
oText.removeTextContent(oSection)
Next i
End Sub
セクションのプロパティ 
プロパティ | 型 | |
Anchor | .text.XTextRange | アンカー |
AnchorType | .text.TextContentAnchorType | アンカータイプ |
AnchorTypes | [].text.TextContentAnchorType | |
BackColor | long | 背景色 |
BackGraphicFilter | string | 背景画像フィルタ |
BackGraphicLocation | .style.GraphicLocation | 背景画像配置 |
BackGraphicURL | string | 背景画像URL |
BackTransparent | boolean | 背景透過 |
ChildSections | [].text.XTextSection | 子要素 |
Condition | string | Hide 時の条件 |
DDECommandElement | string | DDE 要素 |
DDECommandFile | string | DDE ファイル |
DDECommandType | string | DDE コマンドタイプ |
DocumentIndex | .text.XDocumentIndex | インデックス |
DontBalanceTextColumns | boolean | 段組幅自動調整しない |
EditInReadonly | boolean | 読み込み専用時に編集 |
EndRedline | [].beans.PropertyValue | |
EndnoteIsCollectAtTextEnd | boolean | 最後に配置 |
EndnoteIsOwnNumbering | boolean | 別の番号付け |
EndnoteIsRestartNumbering | boolean | 番号付け開始 |
EndnoteNumberingPrefix | string | 番号付け接頭語 |
EndnoteNumberingSuffix | string | 番号付け接尾語 |
EndnoteNumberingType | short | 番号付けタイプ |
EndnoteRestartNumberingAt | short | 番号付け再開する値 |
FileLink | .text.SectionFileLink | ファイルリンク |
FootnoteIsCollectAtTextEnd | boolean | 最後に配置 |
FootnoteIsOwnNumbering | boolean | 別の番号付け |
FootnoteIsRestartNumbering | boolean | 番号付け開始 |
FootnoteNumberingPrefix | string | 番号付け接頭語 |
FootnoteNumberingSuffix | string | 番号付け接尾語 |
FootnoteNumberingType | short | 番号付けタイプ |
FootnoteRestartNumberingAt | short | 番号付け再開時値 |
IsAutomaticUpdate | boolean | DDE 自動アップデート |
IsCurrentlyVisible | boolean | 現在の表示状態 |
IsGlobalDocumentSection | boolean | |
IsProtected | boolean | 保護 |
IsVisible | boolean | 表示 |
LinkDisplayName | string | リンク表示名 |
LinkRegion | string | リンクセクション名 |
Name | string | セクション名 |
ParentSection | .text.XTextSection | 親要素 |
ProtectionKey | []byte | パスワード保護キー |
SectionLeftMargin | long | 左余白 |
SectionRightMargin | long | 右余白 |
StartRedline | [].beans.PropertyValue | |
TextColumns | .text.XTextColumns | 段組み |
TextWrap | .text.WrapTextMode | テキスト回り込み |
WritingMode | short | 文章方向 |