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 支援與意見反應。