Set-SLAlignMent


Synopsis

Set text alignment settings on a single or a range of cells.

Syntax

Description

Set text alignment settings on a single or a range of cells.

Parameters

-WorkBookInstance

Instance of an excel document that can be used for editing.

Required? True
Position? 0
Default value  
Accept pipeline input? true (ByValue)
Accept wildcard characters? False

-WorksheetName

Name of the Worksheet that is to be processed.

Required? False
Position? 1
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-CellReference

The target cell that needs to have the specified alignment settings. Eg: A5 or AB10

Required? True
Position? 2
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-Vertical

Valid values for the Vertical alignment parameter is – &;39;Bottom&;39;,&;39;Center&;39;,&;39;Top&;39;,&;39;Justify&;39;,&;39;Distributed&;39;.

Required? False
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-Horizontal

Valid values for the Horizontal alignment parameter is – &;39;Left&;39;,&;39;Center&;39;,&;39;Right&;39;,&;39;Justify&;39;,&;39;Distributed&;39;.

Required? False
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-TextRotation

Specifies the rotation angle of the text, ranging from -90 degrees to 90 degrees.

Required? False
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-indent

Each indent value is 3 spaces so an indent value of 5 means 15 spaces wide.

Required? False
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-ShrinkToFit

Specifies if the text in the cell should be shrunk to fit the cell.

Required? False
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-WrapText

Specifies if the text in the cell should be wrapped.

Required? False
Position? named
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-Range

The target cell range that needs to have the specified alignment settings. Eg: A5:B10 or AB10:AD20

Required? True
Position? 2
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

String,SpreadsheetLight.SLDocument

Outputs

SpreadsheetLight.SLDocument

Notes

Examples

Example 1

Apply textwrap to cell B3

Example 2

Top align cell content in B3 and then wrap text.

Example 3

Indent text by 9 spaces and set rotation at 80 degrees.

Example 4

Here we apply multiple alignment settings settings to a range of cells.

Related links