ParagraphFormat Object
Word Developer Reference |
Represents all the formatting for a paragraph.
Remarks
Use the Format property to return the ParagraphFormat object for a paragraph or paragraphs. The ParagraphFormat property returns the ParagraphFormat object for a selection, range, style, Find object, or Replacement object. The following example centers the third paragraph in the active document.
Visual Basic for Applications |
---|
|
The following example finds the next double-spaced paragraph after the selection.
Visual Basic for Applications |
---|
|
You can use Visual Basic's New keyword to create a new, standalone ParagraphFormat object. The following example creates a ParagraphFormat object, sets some formatting properties for it, and then applies all of its properties to the first paragraph in the active document.
Visual Basic for Applications |
---|
|
You can also make a standalone copy of an existing ParagraphFormat object by using the Duplicate property. The following example duplicates the paragraph formatting of the first paragraph in the active document and stores the formatting in myDup. The example changes the left indent of myDup to 1 inch, creates a new document, inserts text into the document, and applies the paragraph formatting of myDup to the text.
Visual Basic for Applications |
---|
|
See Also