Alignment Property

Microsoft Word Visual Basic

Show All

Alignment Property

       

Alignment property as it applies to the HorizontalLineFormat object.

Returns or sets a WdHorizontalLineAlignment constant that represents the alignment for the specified horizontal line. Read/write.

WdHorizontalLineAlignment can be one of these WdHorizontalLineAlignment constants.
wdHorizontalLineAlignCenter
wdHorizontalLineAlignRight
wdHorizontalLineAlignLeft

expression.Alignment

expression   Required. An expression that returns a HorizontalLineFormat object.

Alignment property as it applies to the ListLevel object.

Returns or sets a WdListLevelAlignment constant that represents the alignment for the list level of the list template. Read/write.

WdListLevelAlignment can be one of these WdListLevelAlignment constants.
wdListLevelAlignLeft
wdListLevelAlignCenter
wdListLevelAlignRight

expression.Alignment

expression   Required. An expression that returns a ListLevel object.

Alignment property as it applies to the PageNumber object.

Returns or sets a WdPageNumberAlignment constant that represents the alignment for the page number. Read/write.

WdPageNumberAlignment can be one of these WdPageNumberAlignment constants.
wdAlignPageNumberInside
wdAlignPageNumberOutside
wdAlignPageNumberCenter
wdAlignPageNumberLeft
wdAlignPageNumberRight

expression.Alignment

expression   Required. An expression that returns a PageNumber object.

Alignment property as it applies to the Paragraph, ParagraphFormat, and Paragraphs objects.

Returns or sets a WdParagraphAlignment constant that represents the alignment for the specified paragraphs. Read/write.

WdParagraphAlignment can be one of these WdParagraphAlignment constants.
wdAlignParagraphCenter
wdAlignParagraphDistribute
wdAlignParagraphJustify
wdAlignParagraphJustifyHi
wdAlignParagraphJustifyLow
wdAlignParagraphJustifyMed
wdAlignParagraphLeft
wdAlignParagraphRight
wdAlignParagraphThaiJustify

expression.Alignment

expression   Required. An expression that returns a Paragraph, ParagraphFormat, or Paragraphs object.

Remarks

Some of the constants listed above may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.

Alignment property as it applies to the Row, Rows, and TableStyle objects.

Returns or sets a WdRowAlignment constant that represents the alignment for the specified rows. Read/write.

WdRowAlignment can be one of these WdRowAlignment constants.
wdAlignRowLeft
wdAlignRowCenter
wdAlignRowRight

expression.Alignment

expression   Required. An expression that returns a Row, Rows, or TableStyle object.

Alignment property as it applies to the TabStop object.

Returns or sets a WdTabAlignment constant that represents the alignment for the specified tab stop. Read/write.

WdTabAlignment can be one of these WdTabAlignment constants.
wdAlignTabBar
wdAlignTabCenter
wdAlignTabDecimal
wdAlignTabLeft
wdAlignTabList
wdAlignTabRight

expression.Alignment

expression   Required. An expression that returns a TabStop object.

Alignment property as it applies to the TextEffectFormat object.

Returns or sets an MsoTextEffectAlignment constant that represents the alignment for the specified text effect. Read/write.

MsoTextEffectAlignment can be one of these MsoTextEffectAlignment constants.
msoTextEffectAlignmentCentered
msoTextEffectAlignmentLeft
msoTextEffectAlignmentLetterJustify
msoTextEffectAlignmentMixed
msoTextEffectAlignmentRight
msoTextEffectAlignmentStretchJustify
msoTextEffectAlignmentWordJustify

expression.Alignment

expression   Required. An expression that returns a TextEffectFormat object.

Example

As it applies to the Paragraph object.

This example right-aligns the first paragraph in the active document.

Sub AlignParagraph()
    ActiveDocument.Paragraphs(1).Alignment = _
        wdAlignParagraphRight
End Sub

As it applies to the Rows object.

This example centers all the rows in the first table of the active document.

Sub CenterRows()
    ActiveDocument.Tables(1).Rows _
        .Alignment = wdAlignRowCenter
End Sub

As it applies to the TabStop object.

This example centers the first tab stop in the first paragraph of the active document.

Sub CenterTabStop()
    ActiveDocument.Paragraphs(1).TabStops(1) _
        .Alignment = wdAlignTabCenter
End Sub