Publisher) (ParagraphFormat.Alignment 属性

返回或设置表示指定段落对齐方式的 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。