title | keywords | f1_keywords | ms.prod | api_name | ms.assetid | ms.date | ||
---|---|---|---|---|---|---|---|---|
ParagraphFormat.Alignment Property (Publisher) |
vbapb10.chm5439491 |
|
publisher |
|
db66f8b8-a813-418c-2735-e5299e6a6045 |
06/08/2017 |
Returns or sets a PbParagraphAlignmentType constant that represents the alignment for the specified paragraphs. Read/write.
expression. Alignment
_expression_A variable that represents a ParagraphFormat object.
The Alignment property value can be one of the PbParagraphAlignmentType constants declared in the Microsoft Publisher type library.
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