Table of contents
TOC
Collapse the table of content
Expand the table of content

ParagraphFormat.Alignment Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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 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
© 2018 Microsoft