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 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