Publisher) (ParagraphFormat 物件
代表段落的所有格式設定。
註解
使用 TextStyle.ParagraphFormat 屬性可傳回段落或段落的 ParagraphFormat 物件。 ParagraphFormat 屬性會傳回選取範圍、 範圍或樣式的 ParagraphFormat 物件。
使用 Duplicate 方法來複製現有的 ParagraphFormat 物件。
範例
下列範例會置中游標所在位置的段落。 本範例會假設的第一個圖案是文字] 方塊中並沒有其他類型的圖案。
Sub CenterParagraph()
Selection.TextRange.ParagraphFormat _
.Alignment = pbParagraphAlignmentCenter
End Sub
下面範例會複製使用中出版物的第一個段落的段落格式設定,並將儲存在變數中的格式設定。 本範例會複製現有的 ParagraphFormat 物件然後左邊縮排變更為 1 英吋、 會建立新的文字方塊、 插入文字並套用至文字複製的段落格式的段落格式設定。
Sub DuplicateParagraphFormating()
Dim pfmtDup As ParagraphFormat
Set pfmtDup = ActiveDocument.Pages(1).Shapes(1).TextFrame _
.TextRange.ParagraphFormat.Duplicate
pfmtDup.LeftIndent = Application.InchesToPoints(1)
With ActiveDocument.Pages.Add(Count:=1, After:=1)
With .Shapes.AddTextbox(pbTextOrientationHorizontal, _
Left:=72, Top:=72, Width:=200, Height:=100)
With .TextFrame.TextRange
.Text = "This is a test of how to use " & _
"the ParagraphFormat object."
.ParagraphFormat = pfmtDup
End With
End With
End With
End Sub
方法
屬性
- Alignment
- 應用程式
- AttachedToText
- CharBasedFirstLineIndent
- FirstLineIndent
- KashidaPercentage
- KeepLinesTogether
- KeepWithNext
- LeftIndent
- LineSpacing
- LineSpacingRule
- ListBulletFontName
- ListBulletFontSize
- ListBulletText
- ListIndent
- ListNumberSeparator
- ListNumberStart
- ListType
- LockToBaseLine
- Parent
- RightIndent
- SpaceAfter
- SpaceBefore
- StartInNextTextBox
- 索引標籤
- TextDirection
- TextStyle
- UseCharBasedFirstLineIndent
- WidowControl
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。