Hallo
erstmal vielen Dank für die Erklärung Begriff IMHO.
XRAY habe ich probiert, das gibt eine ganze Menge Informationen und daher schon recht hilfreich.
Dies hat mir aber auch gezeigt, dass OOO mich nicht verstehen will. Die gewünschten Werte werden nicht übernommen.
Hier nochmal der Code
Code: Alles auswählen
REM ***** BASIC *****
Option Explicit
Sub Main
rem Testen der Formatierung für Zellen
GlobalScope.BasicLibraries.LoadLibrary("XrayTool")
rem Variable definieren
dim oDocument as object
dim oSheet as object
dim oCell as object
rem ----------------------------------------------------------------------
rem get access to the document
oDocument=ThisComponent
rem ####################################################################################################################################
rem Tabelle festlegen
oSheet=oDocument.Sheets.getByName("Objects")
rem ####################################################################################################################################
oCell = oSheet.getCellByPosition(1, 5)
oCell.VertJustify = com.sun.star.table.CellVertJustify.TOP ' Ausrichtung Oben
oCell.HoriJustify = com.sun.star.table.CellHoriJustify.LEFT ' Ausrichtung links
ocell.CellBackColor = 11456256 ' Hintergrund blassgün
ocell.CharFontName = "Arial" ' Verwendeter Font Arial
ocell.CharWeight = com.sun.star.awt.FontWeight.BOLD ' Fettschrift
ocell.CharHeight = 8 ' Fontgrösse 8
ocell.IsTextWrapped = false
oCell.LeftBorder.Color = 0
oCell.LeftBorder.InnerLineWidth = 0
oCell.LeftBorder.OuterLineWidth = 35
oCell.RightBorder.Color = 0
oCell.RightBorder.InnerLineWidth = 0
oCell.RightBorder.OuterLineWidth = 35
oCell.TopBorder.Color = 0
oCell.TopBorder.InnerLineWidth = 0
oCell.TopBorder.OuterLineWidth = 35
oCell.BottomBorder.Color = 0
oCell.BottomBorder.InnerLineWidth = 2
oCell.BottomBorder.OuterLineWidth = 2
oCell.BottomBorder.LineDistance = 35
xray oCell
End Sub
XRAY zeigt dann, dass die Werte für die Border nicht übernommen werden. Bei den anderen Werten scheint es zu funktionieren.
Wenn ich mit XRAY die Zelle beschreiben lasse, bekomme ich folgende Antwort:
AbsoluteName string "$Objects.$B$6" read-only
ActionLocks short pseudo-prop, write-only
Annotation com.sun.star.sheet.XSheetAnnotation pseudo-prop, read-only
ArrayFormula string "" pseudo-prop
ArrayTokens []com.sun.star.sheet.FormulaToken <empty> pseudo-prop
AsianVerticalMode boolean False
BottomBorder com.sun.star.table.BorderLine
CellAddress com.sun.star.table.CellAddress pseudo-prop, read-only
CellBackColor long 11456256
CellFormatRanges com.sun.star.container.XIndexAccess pseudo-prop, read-only
CellProtection com.sun.star.util.CellProtection
CellStyle string "Standard_Induvidials_neu"
CharColor long -1
CharContoured boolean False
CharCrossedOut boolean False
CharEmphasis short 0
CharFont short 5
CharFontCharSet short 1
CharFontCharSetAsian short 1
CharFontCharSetComplex short 1
CharFontFamily short 5
CharFontFamilyAsian short 6
CharFontFamilyComplex short 5
CharFontName string "Arial"
CharFontNameAsian string "Microsoft YaHei"
CharFontNameComplex string "Arial"
CharFontPitch short 2
CharFontPitchAsian short 2
CharFontPitchComplex short 0
CharFontStyleName string ""
CharFontStyleNameAsian string ""
CharFontStyleNameComplex string ""
CharHeight float 8
CharHeightAsian float 8
CharHeightComplex float 8
CharLocale com.sun.star.lang.Locale
CharLocaleAsian com.sun.star.lang.Locale
CharLocaleComplex com.sun.star.lang.Locale
CharOverline short 0
CharOverlineColor long -1
CharOverlineHasColor boolean False
CharPosture com.sun.star.awt.FontSlant 0 enum: com.sun.star.awt.FontSlant.NONE
CharPostureAsian com.sun.star.awt.FontSlant 0 enum: com.sun.star.awt.FontSlant.NONE
CharPostureComplex com.sun.star.awt.FontSlant 0 enum: com.sun.star.awt.FontSlant.NONE
CharRelief short 0
CharShadowed boolean False
CharStrikeout short 0
ChartColumnAsLabel boolean False
ChartRowAsLabel boolean False
CharUnderline short 0
CharUnderlineColor long -1
CharUnderlineHasColor boolean False
CharWeight float 150
CharWeightAsian float 100
CharWeightComplex float 100
CharWordMode boolean False
ColumnDescriptions []string pseudo-prop
Columns com.sun.star.table.XTableColumns pseudo-prop, read-only
ConditionalFormat com.sun.star.sheet.XSheetConditionalEntries
ConditionalFormatLocal com.sun.star.sheet.XSheetConditionalEntries
ConditionalFormatXML com.sun.star.sheet.XSheetConditionalEntries
Data [][]double pseudo-prop
DataArray [][]any pseudo-prop
Dbg_Methods string <...> basic prop, read-only
Dbg_Properties string <...> basic prop, read-only
Dbg_SupportedInterfaces string <...> basic prop, read-only
DiagonalBLTR com.sun.star.table.BorderLine
DiagonalTLBR com.sun.star.table.BorderLine
ElementType type pseudo-prop, read-only
End com.sun.star.text.XTextRange pseudo-prop, read-only
Error long 0 pseudo-prop, read-only
Formula string "M2946" pseudo-prop
FormulaArray [][]string pseudo-prop
FormulaLocal string "M2946"
FormulaResultType com.sun.star.table.CellContentType 2 read-only, enum: com.sun.star.table.CellContentType.TEXT
HoriJustify com.sun.star.table.CellHoriJustify 1 enum: com.sun.star.table.CellHoriJustify.LEFT
ImplementationId []byte pseudo-prop, read-only
ImplementationName string "ScCellObj" pseudo-prop, read-only
IsCellBackgroundTransparent boolean False
IsMerged boolean False pseudo-prop, read-only
IsTextWrapped boolean False
LeftBorder com.sun.star.table.BorderLine
NotANumber double 2.2250738585072E-308 pseudo-prop, read-only
NumberFormat long 10100
NumberingRules com.sun.star.container.XIndexReplace
Orientation com.sun.star.table.CellOrientation 0 enum: com.sun.star.table.CellOrientation.STANDARD
ParaAdjust short 0
ParaBottomMargin long 35
ParaIndent short 0
ParaIsCharacterDistance boolean False
ParaIsForbiddenRules boolean False
ParaIsHangingPunctuation boolean False
ParaIsHyphenation boolean False
ParaLastLineAdjust short 0
ParaLeftMargin long 35
ParaRightMargin long 35
ParaTopMargin long 35
Position com.sun.star.awt.Point read-only
PropertySetInfo com.sun.star.beans.XPropertySetInfo pseudo-prop, read-only
PropertyToDefault string pseudo-prop, write-only
RangeAddress com.sun.star.table.CellRangeAddress pseudo-prop, read-only
RightBorder com.sun.star.table.BorderLine
RotateAngle long 0
RotateReference com.sun.star.table.CellVertJustify 0 enum: com.sun.star.table.CellVertJustify.STANDARD
RowDescriptions []string pseudo-prop
Rows com.sun.star.table.XTableRows pseudo-prop, read-only
ShadowFormat com.sun.star.table.ShadowFormat
ShrinkToFit boolean False
Size com.sun.star.awt.Size read-only
Spreadsheet com.sun.star.sheet.XSpreadsheet pseudo-prop, read-only
Start com.sun.star.text.XTextRange pseudo-prop, read-only
String string "M2946" pseudo-prop
SupportedServiceNames []string pseudo-prop, read-only
TableBorder com.sun.star.table.TableBorder
Text com.sun.star.text.XText pseudo-prop, read-only
TextFieldMasters com.sun.star.container.XNameAccess <null> pseudo-prop, read-only
TextFields com.sun.star.container.XEnumerationAccess pseudo-prop, read-only
Tokens []com.sun.star.sheet.FormulaToken <empty> pseudo-prop
TopBorder com.sun.star.table.BorderLine
Type com.sun.star.table.CellContentType 2 pseudo-prop, read-only, enum: com.sun.star.table.CellContentType.TEXT
Types []type pseudo-prop, read-only
UniqueCellFormatRanges com.sun.star.container.XIndexAccess pseudo-prop, read-only
UserDefinedAttributes com.sun.star.container.XNameContainer
Validation com.sun.star.beans.XPropertySet
ValidationLocal com.sun.star.beans.XPropertySet
ValidationXML com.sun.star.beans.XPropertySet
Value double 0 pseudo-prop
VertJustify com.sun.star.table.CellVertJustify 1 enum: com.sun.star.table.CellVertJustify.TOP
WritingMode short 4
Für den Rahmen z.B.
Color long 0
InnerLineWidth short 0
LineDistance short 0
OuterLineWidth short 0
Hat jemand eine Idee wie man OOO dazu bringen kann, die Daten für den Rahmen zu akzeptieren ???
Bitte nicht manuell, das ist bei der gewünschten Flexibilität sehr unpraktisch.