Objet ParagraphFormat (Publisher)
Cet objet représente l'ensemble des mises en forme d'un paragraphe.
Remarques
Utilisez la propriété TextStyle.ParagraphFormat pour renvoyer l’objet ParagraphFormat pour un ou plusieurs paragraphes. La propriété ParagraphFormat renvoie l'objet ParagraphFormat d'une sélection, une plage ou style.
Utilisez la méthode Duplicate pour copier un objet ParagraphFormat existant.
Exemple
L'exemple suivant centre le paragraphe au niveau du curseur. Cet exemple suppose que la première forme est une zone de texte et non un autre type de forme.
Sub CenterParagraph()
Selection.TextRange.ParagraphFormat _
.Alignment = pbParagraphAlignmentCenter
End Sub
L'exemple suivant duplique la mise en forme de paragraphe du premier paragraphe de la composition active et stocke la mise en forme dans la variable. Cet exemple montre comment duplique un objet ParagraphFormat existant puis modifie le retrait gauche pour un pouce, crée une nouvelle zone de texte, insérer du texte et applique la mise en forme de paragraphe du format de paragraphe dupliqué au texte.
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
Méthodes
Propriétés
- Alignment
- Application
- AttachedToText
- CharBasedFirstLineIndent
- FirstLineIndent
- KashidaPercentage
- KeepLinesTogether
- KeepWithNext
- LeftIndent
- LineSpacing
- LineSpacingRule
- ListBulletFontName
- ListBulletFontSize
- ListBulletText
- ListIndent
- ListNumberSeparator
- ListNumberStart
- ListType
- LockToBaseLine
- Parent
- RightIndent
- SpaceAfter
- SpaceBefore
- StartInNextTextBox
- Onglets
- TextDirection
- TextStyle
- UseCharBasedFirstLineIndent
- WidowControl
Voir aussi
Assistance et commentaires
Avez-vous des questions ou des commentaires sur Office VBA ou sur cette documentation ? Consultez la rubrique concernant l’assistance pour Office VBA et l’envoi de commentaires afin d’obtenir des instructions pour recevoir une assistance et envoyer vos commentaires.