ParagraphFormat.Alignment property (Publisher)
Returns or sets a PbParagraphAlignmentType constant that represents the alignment for the specified paragraphs. Read/write.
Syntax
expression.Alignment
expression A variable that represents a ParagraphFormat object.
Remarks
The Alignment property value can be one of the PbParagraphAlignmentType constants declared in the Microsoft Publisher type library.
Example
This example adds a new text box to the first page of the active publication, and then adds 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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.