ParagraphFormat.Alignment 属性 (Publisher)

返回或设置一个 PbParagraphAlignmentType 常量,该常量代表指定段落的对齐方式。 读/写。

语法

表达式对准

表达 一个代表 ParagraphFormat 对象的变量。

备注

Alignment 属性值可以是 Microsoft Publisher 类型库中声明的 PbParagraphAlignmentType 常量之一。

示例

本示例向当前出版物的第一页添加新文本框,然后添加文本并设置段落对齐方式和字体格式。

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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。