The following example toggles the space-before formatting of the first paragraph in the selection. Switching the space before a paragraph between 12 points and none Set rngFormat = ActiveDocument.Range(Start:=0, End:=0) The word "Title" is formatted with 24-point Arial font. The first paragraph is center-aligned and one half-inch space is added after the paragraph. The following example adds the word "Title" at the top of the current document. Inserting text and applying character and paragraph formatting ParagraphFormat.Alignment = wdAlignParagraphJustify Start:=ActiveDocument.Paragraphs(1).Range.Start, _Įnd:=ActiveDocument.Paragraphs(3).Range.End) The Range is formatted by applying properties of the Font object and the ParagraphFormat object. The following example defines a Range object that refers to the first three paragraphs in the active document. Use the Font property to access character formatting properties and methods and the ParagraphFormat property to access paragraph formatting properties and methods. The following example uses the Selection property to apply character and paragraph formatting to the selected text. This topic includes Visual Basic examples related to the tasks in the following sections.
0 Comments
Leave a Reply. |