オートフォーマット 
表のオートフォーマット。
設定ファイルが config/autotbl.fmt にあるがフォーマット不明。その代わり TableAutoFormats サービスで管理できます。でもサービスから読み込み、保存、などはできません。また、拡張機能としての配布もサポートされていません。
サービス 
TableAutoFormats サービスをインスタンス化します。
oTableAutoFormats = CreateUnoService( _
"com.sun.star.sheet.TableAutoFormats" )
各オートフォーマットの管理には主に下記のインターフェースが利用できます。
- com.sun.star.container.XElementAccess
- com.sun.star.container.XEnumerationAccess
- com.sun.star.container.XIndexAccess
- com.sun.star.container.XNameAccess
- com.sun.star.container.XNameContainer
- com.sun.star.container.XNameReplace
適用 
セル範囲にオートフォーマットを適用します。autoFormat メソッドの引数にオートフォーマット名を指定します。
oCellRange = oSheet.getCellRangeByPosition(0, 0, 5, 5)
oCellRange.autoFormat("User")
取得 
コンテナから各オートフォーマットにアクセスします。返り値は TableAutoFormat です。
oObj1 = oTableAutoFormats.getByIndex( 0 )
oObj2 = oTableAutoFormats.getByName( "User1" )
次のようなインターフェースをサポートしており、各フィールドの設定を保持しています。
- com.sun.star.container.XElementAccess
- com.sun.star.container.XEnumerationAccess
- com.sun.star.container.XIndexAccess
- com.sun.star.container.XNamed
各要素は .sheet.TableAutoFormatField サービスのインスタンスです。
設定 
各オートフォーマットのオプション設定。プロパティ値として設定します。
オプション | 型 | 説明 |
IncludeBackground | boolean | 背景を含む |
IncludeBorder | boolean | 枠線を含む |
IncludeFont | boolean | フォント設定を含む |
IncludeJustify | boolean | 位置合わせを含む |
IncludeNumberFormat | boolean | 数書式設定を含む |
IncludeWidthAndHeight | boolean | 幅と高さを含む |
フィールド 
コンテナから取得できるフィールドは表オートフォーマットを作成する時の 4 x 4 セル範囲の左上から右に向かってインデックス 0 - 16 になります。オートフォーマットのダイアログに表示されている順番とは異なります。
セルのスタイルと同じような内容です。
プロパティ | 型 | 説明 |
CellBackColor | long | |
CharColor | long | |
CharContoured | boolean | |
CharCrossedOut | boolean | |
CharFont | short | |
CharFontCharSet | short | |
CharFontCharSetAsian | short | |
CharFontCharSetComplex | short | |
CharFontFamily | short | |
CharFontFamilyAsian | short | |
CharFontFamilyComplex | short | |
CharFontName | string | |
CharFontNameAsian | string | |
CharFontNameComplex | string | |
CharFontPitch | short | |
CharFontPitchAsian | short | |
CharFontPitchComplex | short | |
CharFontStyleName | string | |
CharFontStyleNameAsian | string | |
CharFontStyleNameComplex | string | |
CharHeight | float | |
CharHeightAsian | float | |
CharHeightComplex | float | |
CharPosture | .awt.FontSlant | |
CharPostureAsian | .awt.FontSlant | |
CharPostureComplex | .awt.FontSlant | |
CharShadowed | boolean | |
CharUnderline | short | |
CharWeight | float | |
CharWeightAsian | float | |
CharWeightComplex | float | |
HoriJustify | .table.CellHoriJustify | |
ImplementationId | []byte | |
ImplementationName | string | |
IsCellBackgroundTransparent | boolean | |
IsTextWrapped | boolean | |
Orientation | .table.CellOrientation | |
ParaBottomMargin | long | |
ParaLeftMargin | long | |
ParaRightMargin | long | |
ParaTopMargin | long | |
PropertySetInfo | .beans.XPropertySetInfo | |
RotateAngle | long | |
RotateReference | .table.CellVertJustify | |
SupportedServiceNames | []string | |
TableBorder | .table.TableBorder | |
Types | []type | |
VertJustify | .table.CellVertJustify | |
作成と挿入 
新しく作成するには (なぜか) ドキュメントの XMultiServiceFactory インターフェースを利用してcom.sun.star.sheet.TableAutoFormat サービスをインスタンス化します。
oDoc = ThisComponent
oTableAutoFormat = oDoc.createInstance("com.sun.star.sheet.TableAutoFormat")
作成したオートフォーマットは名前を指定して挿入します。
oTableAutoFormats.insertByName( "New_1", oTableAutoFormat)
または置換できます。
oTableAutoFormats.replaceByName( "New_1", oTableAutoFormat)
削除 
削除は removeByName メソッドで行います。
oTableAutoFormats.removeByName("New_1")