mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Relayout of Setformat for readablity
This commit is contained in:
@@ -92,27 +92,31 @@
|
||||
}
|
||||
else {
|
||||
if ($ResetFont) {
|
||||
$Address.Style.Font.Color.SetColor("Black")
|
||||
$Address.Style.Font.Bold = $false
|
||||
$Address.Style.Font.Italic = $false
|
||||
$Address.Style.Font.UnderLine = $false
|
||||
$Address.Style.Font.Strike = $false
|
||||
$Address.Style.Font.Color.SetColor("Black")
|
||||
$Address.Style.Font.Bold = $false
|
||||
$Address.Style.Font.Italic = $false
|
||||
$Address.Style.Font.UnderLine = $false
|
||||
$Address.Style.Font.Strike = $false
|
||||
}
|
||||
if ($Underline) {
|
||||
$Address.Style.Font.UnderLine = $true
|
||||
$Address.Style.Font.UnderLineType = $UnderLineType
|
||||
if ($Underline) {
|
||||
$Address.Style.Font.UnderLine = $true
|
||||
$Address.Style.Font.UnderLineType = $UnderLineType
|
||||
}
|
||||
if ($Bold) {$Address.Style.Font.Bold = $true }
|
||||
if ($Italic) {$Address.Style.Font.Italic = $true }
|
||||
if ($StrikeThru) {$Address.Style.Font.Strike = $true }
|
||||
if ($FontShift) {$Address.Style.Font.VerticalAlign = $FontShift }
|
||||
if ($FontColor) {$Address.Style.Font.Color.SetColor( $FontColor ) }
|
||||
|
||||
if ($BorderAround) {
|
||||
$Address.Style.Border.BorderAround($BorderAround, $BorderColor)
|
||||
}
|
||||
if ($Bold) {$Address.Style.Font.Bold = $true }
|
||||
if ($Italic) {$Address.Style.Font.Italic = $true }
|
||||
if ($StrikeThru) {$Address.Style.Font.Strike = $true }
|
||||
if ($FontShift) {$Address.Style.Font.VerticalAlign = $FontShift }
|
||||
if ($FontColor) {$Address.Style.Font.Color.SetColor( $FontColor ) }
|
||||
if ($NumberFormat) {$Address.Style.Numberformat.Format = $NumberFormat }
|
||||
if ($TextRotation) {$Address.Style.TextRotation = $TextRotation }
|
||||
if ($WrapText) {$Address.Style.WrapText = $true }
|
||||
if ($HorizontalAlignment) {$Address.Style.HorizontalAlignment = $HorizontalAlignment }
|
||||
if ($VerticalAlignment) {$Address.Style.VerticalAlignment = $VerticalAlignment }
|
||||
if ($Value) {$Address.Value = $Value }
|
||||
if ($Formula) {$Address.Formula = $Formula }
|
||||
if ($BorderAround) {$Address.Style.Border.BorderAround($BorderAround, $BorderColor)}
|
||||
|
||||
if ($BorderBottom) {
|
||||
if ($BorderBottom) {
|
||||
$Address.Style.Border.Bottom.Style=$BorderBottom
|
||||
$Address.Style.Border.Bottom.Color.SetColor($BorderColor)
|
||||
}
|
||||
@@ -132,12 +136,6 @@
|
||||
$Address.Style.Border.Right.Color.SetColor($BorderColor)
|
||||
}
|
||||
|
||||
if ($NumberFormat) {$Address.Style.Numberformat.Format = $NumberFormat }
|
||||
if ($TextRotation) {$Address.Style.TextRotation = $TextRotation }
|
||||
if ($WrapText) {$Address.Style.WrapText = $true }
|
||||
if ($HorizontalAlignment) {$Address.Style.HorizontalAlignment = $HorizontalAlignment }
|
||||
if ($VerticalAlignment) {$Address.Style.VerticalAlignment = $VerticalAlignment }
|
||||
|
||||
if ($BackgroundColor) {
|
||||
$Address.Style.Fill.PatternType = $BackgroundPattern
|
||||
$Address.Style.Fill.BackgroundColor.SetColor($BackgroundColor)
|
||||
@@ -179,13 +177,6 @@
|
||||
else {Write-Warning -Message ("Can hide a row or a column but not a {0} object" -f ($Address.GetType().name)) }
|
||||
}
|
||||
|
||||
if ($Value) {
|
||||
$Address.Value = $Value
|
||||
}
|
||||
|
||||
if ($Formula) {
|
||||
$Address.Formula = $Formula
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user