傳回或設定代表指定段落對齊方式的 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 支援與意見反應。