Share via


Alignment Property [Publisher 2003 VBA Language Reference]

Alignment property as it applies to the TextEffectFormat object.

MsoTextEffectAlignment

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.

Alignment property as it applies to the ParagraphFormat object.

PbParagraphAlignmentType

PbParagraphAlignmentType can be one of these PbParagraphAlignmentType constants.
pbParagraphAlignmentCenter
pbParagraphAlignmentDistribute
pbParagraphAlignmentDistributeAll
pbParagraphAlignmentDistributeCenterLast
pbParagraphAlignmentDistributeEastAsia
pbParagraphAlignmentInterCluster
pbParagraphAlignmentInterIdeograph
pbParagraphAlignmentInterWord
pbParagraphAlignmentJustified
pbParagraphAlignmentKashida
pbParagraphAlignmentLeft
pbParagraphAlignmentMixed
pbParagraphAlignmentRight

expression.Alignment

expression Required. An expression that returns a ParagraphFormat object.

Alignment property as it applies to the PhoneticGuide object.

PbPhoneticGuideAlignmentType

PbPhoneticGuideAlignmentType can be one of these PbPhoneticGuideAlignmentType constants.
pbPhoneticGuideAlignmentCenter
pbPhoneticGuideAlignmentDefault
pbPhoneticGuideAlignmentLeft
pbPhoneticGuideAlignmentOneTwoOne
pbPhoneticGuideAlignmentRight
pbPhoneticGuideAlignmentZeroOneZero

expression.Alignment

expression Required. An expression that returns a PhoneticGuide object.

Alignment property as it applies to the TabStop object.

PbTabAlignmentType

PbTabAlignmentType can be one of these PbTabAlignmentType constants.
pbTabAlignmentCenter
pbTabAlignmentDecimal
pbTabAlignmentLeading
pbTabAlignmentTrailing

expression.Alignment

expression Required. An expression that returns a TabStop object.

Example

As it applies to the ParagraphFormat object.

This example adds a new text box to the first page of the active publication, and then add text and sets the paragraph alignment and font formatting.

Sub NewTextFrame()
    Dim shpTextBox As Shape
    Set shpTextBox = ActiveDocument.Pages(1).Shapes _
        .AddTextbox(Orientation:=pbTextOrientationHorizontal, _
        Left:=72, Top:=72, Width:=468, Height:=72)
    With shpTextBox.TextFrame.TextRange
        .ParagraphFormat.Alignment = pbParagraphAlignmentCenter
        .Text = "Hello World"
        With .Font
            .Name = "Snap ITC"
            .Size = 30
            .Bold = msoTrue
        End With
    End With
End Sub

As it applies to the TabStop object.

This example enters a tabbed list and sets the alignment for two custom tab stops. This example assumes that the specified shape is a text frame and not another type of shape and that there are at least two custom tab stops already set.

Sub CustomDecimalTabStop()

    With ActiveDocument.Pages(1).Shapes(1).TextFrame.TextRange
        .InsertAfter Newtext:="Pencils" & vbTab & _
            "Each" & vbTab & "1.50" & vbLf
        .InsertAfter Newtext:="Pens" & vbTab & _
            "Each" & vbTab & "4.95" & vbLf
        .InsertAfter Newtext:="Folders" & vbTab & _
            "Box" & vbTab & "35.28" & vbLf
        .InsertAfter Newtext:="Envelopes" & vbTab & _
            "Case" & vbTab & "150.69" & vbLf
        With .Paragraphs(Start:=1).ParagraphFormat
            .Tabs(1).Alignment = pbTabAlignmentCenter
            .Tabs(2).Alignment = pbTabAlignmentDecimal
        End With
    End With
End Sub

Applies to | ParagraphFormat Object | PhoneticGuide Object | TabStop Object | TextEffectFormat Object