Paragraphs Collection Object
Multiple objects Paragraphs Multiple objects |
A collection of Paragraph objects in a selection, range, or document.
Using the Paragraphs Collection
Use the Paragraphs property to return the Paragraphs collection. The following example formats the selected paragraphs to be double-spaced and right-aligned.
With Selection.Paragraphs
.Alignment = wdAlignParagraphRight
.LineSpacingRule = wdLineSpaceDouble
End With
Use the Add , InsertParagraph , InsertParagraphAfter , or InsertParagraphBefore method to add a new paragraph to a document. The following example adds a new paragraph before the first paragraph in the selection.
Selection.Paragraphs.Add Range:=Selection.Paragraphs(1).Range
The following example also adds a paragraph before the first paragraph in the selection.
Selection.Paragraphs(1).Range.InsertParagraphBefore
Use Paragraphs(index), where index is the index number, to return a single Paragraph object. The following example right aligns the first paragraph in the active document.
ActiveDocument.Paragraphs(1).Alignment = wdAlignParagraphRight
Remarks
The Count property for this collection in a document returns the number of items in the main story only. To count items in other stories use the collection with the Range object.
Properties | AddSpaceBetweenFarEastAndAlpha Property | AddSpaceBetweenFarEastAndDigit Property | Alignment Property | Application Property | AutoAdjustRightIndent Property | BaseLineAlignment Property | Borders Property | CharacterUnitFirstLineIndent Property | CharacterUnitLeftIndent Property | CharacterUnitRightIndent Property | Count Property | Creator Property | DisableLineHeightGrid Property | FarEastLineBreakControl Property | First Property | FirstLineIndent Property | Format Property | HalfWidthPunctuationOnTopOfLine Property | HangingPunctuation Property | Hyphenation Property | KeepTogether Property | KeepWithNext Property | Last Property | LeftIndent Property | LineSpacing Property | LineSpacingRule Property | LineUnitAfter Property | LineUnitBefore Property | NoLineNumber Property | OutlineLevel Property | PageBreakBefore Property | Parent Property | ReadingOrder Property | RightIndent Property | Shading Property | SpaceAfter Property | SpaceAfterAuto Property | SpaceBefore Property | SpaceBeforeAuto Property | Style Property | TabStops Property | WidowControl Property | WordWrap Property
Methods | Add Method | CloseUp Method | DecreaseSpacing Method | IncreaseSpacing Method | Indent Method | IndentCharWidth Method | IndentFirstLineCharWidth Method | Item Method | OpenOrCloseUp Method | OpenUp Method | Outdent Method | OutlineDemote Method | OutlineDemoteToBody Method | OutlinePromote Method | Reset Method | Space1 Method | Space15 Method | Space2 Method | TabHangingIndent Method | TabIndent Method
Parent Objects | Document Object | Range Object | Selection Object
Child Objects | Borders Object | Paragraph Object | ParagraphFormat Object | Shading Object | TabStops Object
See Also | ParagraphFormat Object