Listing A Procedure That Uses Selection Extension to Format Different Aspects of a Paragraph

Sub FormatFirstParagraph()

1 Select the first word in the first paragraph

ActiveDocument.Paragraphs(1).Range.Words(1).Select With Selection

1 Extend the select to the first three words

.MoveRight wdWord, 2, wdExtend

' Convert the selection to uppercase

.Range.Case = wdUpperCase

' Extend the selection to the entire paragraph .MoveDown wdParagraph, 1, wdExtend 1 Set the paragraph font size to 14 .Range.Font.Size = 14

0 0

Post a comment