Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
54 lines (37 loc) · 1.33 KB

paragraphformat-alignment-property-publisher.md

File metadata and controls

54 lines (37 loc) · 1.33 KB
title keywords f1_keywords ms.prod api_name ms.assetid ms.date
ParagraphFormat.Alignment Property (Publisher)
vbapb10.chm5439491
vbapb10.chm5439491
publisher
Publisher.ParagraphFormat.Alignment
db66f8b8-a813-418c-2735-e5299e6a6045
06/08/2017

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