This documentation is archived and is not being maintained.

Label.TextAlign Property

Office 2007
The TextAlign property specifies the text alignment in new controls. Read/write Byte.

Syntax

expression.TextAlign

expression   A variable that represents a Label object.

Remarks

The TextAlign property uses the following settings.

SettingVisual BasicDescription
General0(Default) The text aligns to the left; numbers and dates align to the right.
Left1The text, numbers, and dates align to the left.
Center2The text, numbers, and dates are centered.
Right3The text, numbers, and dates align to the right.
Distribute4The text, numbers, and dates are evenly distributed.

You can set the default for the TextAlign property by using a control's default control style or the DefaultControl property in Visual Basic.

Example

The following example aligns the text in the "Address" text box on the "Suppliers" form to the right.

Visual Basic for Applications
Forms("Suppliers").Controls("Address").TextAlign = 3


Show: